POV-Ray : Newsgroups : povray.unofficial.patches : #let keyword(was: Previews of Ice Planet...) Server Time
2 Sep 2024 04:14:50 EDT (-0400)
  #let keyword(was: Previews of Ice Planet...) (Message 11 to 20 of 35)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Psychomek
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 2 Sep 2000 09:52:07
Message: <39B107E7.976DB08E@home.com>
u might be right i stand corrected.....

Chris Huff wrote:

> In article <39B### [at] homecom>, Psychomek <psy### [at] homecom>
> wrote:
>
> > what about #mod or #fix?
>
> The keyword "mod" is a function(mod(), for modulus), and even I don't
> understand #fix, so it would probably be far worse for a new user.
>
> --
> Christopher James Huff
> Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
> TAG: chr### [at] tagpovrayorg, http://tag.povray.org/
>
> <><


Post a reply to this message

From: Warp
Subject: Re: #let keywor
Date: 3 Sep 2000 14:22:37
Message: <39b296ec@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:
: I think the best keyword would be #modify, but it is already used

  Is it? What does it do? A megapov feature, I suppose?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: #let keywor
Date: 3 Sep 2000 14:28:33
Message: <chrishuff-767435.13301303092000@news.povray.org>
In article <39b296ec@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   Is it? What does it do? A megapov feature, I suppose?

Something to do with persistent objects, I think. The syntax is a bit 
strange...

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Peter J  Holzer
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 3 Sep 2000 20:00:45
Message: <slrn8r5jct.hvs.hjp-usenet@teal.h.hjp.at>
On Thu, 31 Aug 2000 16:56:11 -0500, Chris Huff wrote:
>The real keyword is #set...I think "let" is a BASIC keyword for creating 
>variables, which is why I didn't use it. The keyword I chose, "set", 
>describes what the keyword does, and is nice and short compared to 
>#local and #declare(which helps to make it stand out visually).

When I learned BASIC (1983), you didn't have to create any variables,
they were created automatically on first use. "let" simply started an
assignment statement, but it was optional, so you could either write

    10 LET A = SQR(2)

or 

    10 A = SQR(2)

Arrays would be dimensioned with DIM, so could write

    10 DIM A$(30)

to create an Array of 31 Strings. If you didn't use DIM, the array
would be created with 11 elements at first use. Some dialects allowed
you to resize arrays at runtime. 

I think later dialects also used DIM to define structures and other
complex data types, but at that time I was already off to other
programming languages.

[alternatives snipped]

I would prefer if no keyword was necessary at all, just 

    # a = a + 5

I think this should be possible with minor changes in the parser, since
keywords cannot be used as variable names anyway.

If not, I think #set is best, followed by #let (for old times' sake :-)
The alternatives are too long and not any clearer than these.

	hp

-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

From: Peter J  Holzer
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 3 Sep 2000 20:00:46
Message: <slrn8r5mg4.hvs.hjp-usenet@teal.h.hjp.at>
On Fri, 01 Sep 2000 00:24:51 -0400, J Charter wrote:
>But I know you'll be excited to recall that "set" is a Cobol! instruction...

Yes, but only in the optional table handling module.

>knowing the reverence you young guys still have for it ;-)

Yeah, lets turn POVray in COSOL (COmmon Scene Oriented Language):

       IDENTIFICATION DIVISION.
       SCENE-ID. BOBBING-SPHERE-ABOVE-CHECKERED-PLANE.
       AUTHOR. PETER J. HOLZER
       ENVIRONMENT DIVISION.
       CONFIGURATON SECTION.
       SPECIAL NAMES.
           METALS IS "/usr/local/lib/povray/include/metals.inc".
           COLORS IS "/usr/local/lib/povray/include/colors.inc".
       INPUT-OUTPUT-SECTION.
           SELECT OUTPUT AS "SPHERE99.PNG"
	   ORGANIZATION PNG
           MODIFY FILENAME BY CLOCK.
       DATA DIVISION.
       01  THE-SPHERE.
       02  TYPE SPHERE.
       02  RADIUS 10.
       02  LOCATION (0, 20, 0).
       02  TEXTURE
       03  COPY METAL-C OF METALS.
       01  THE-PLANE.
       02  TYPE PLANE.
       02  NORMAL (0, 1, 0).
       02  OFFSET 0.
       02  TEXTURE
       03  TYPE CHECKER
       04  COPY RED OF COLORS.
       04  COPY GREEN OF COLORS.
       01  CAMERA.
       02  POSITION (0, 15, -30)
       02  LOOK AT (0, 15, 0).
       77  HEIGHT PIC COMP.
       ANIMATION DIVISION.
           RENDER FRAMES 0 THRU 35
           VARYING CLOCK FROM 0 THRU 350.
       RENDER DIVISION.
           APPLY ROTATION AROUND Y AXIS BY CLOCK DEGREES TO CAMERA.
           COMPUTE SINUS OF CLOCK GIVING HEIGHT.
           MULTIPLY HEIGHT BY 10 GIVING HEIGHT.
           APPLY TRANSLATION BY HEIGHT UNITS ALONG Y AXIS TO THE-SPHERE.
           RENDER IT.
           DISPLAY STATISTICS.

    SCNR,
        hp

PS: I admit that I had to dust off my old Cobol manual to write this.

-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

From: Chris Huff
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 3 Sep 2000 20:52:04
Message: <chrishuff-F17AC1.19534403092000@news.povray.org>
In article <slr### [at] tealhhjpat>, 
hjp### [at] SiKituwsracat (Peter J. Holzer) wrote:

> I would prefer if no keyword was necessary at all, just 
> 
>     # a = a + 5
> 
> I think this should be possible with minor changes in the parser, since
> keywords cannot be used as variable names anyway.

That might be quite possible...but you should always use upper case to 
avoid name conflicts, since new keywords are always lower case. :-)

It also looks like it might be easy to allow semicolons after every 
assignment, something that I wish POV already did.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 3 Sep 2000 21:35:44
Message: <39b2fc70$1@news.povray.org>
In article <slr### [at] tealhhjpat> , 
hjp### [at] SiKituwsracat (Peter J. Holzer) wrote:

> I would prefer if no keyword was necessary at all, just
>
>     # a = a + 5

I have to admit, I kind of like this idea ... and it does not add a
additional symbol to the scene language.


    Thorsten


Post a reply to this message

From: Chris Huff
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 3 Sep 2000 22:06:07
Message: <chrishuff-9358DC.21074603092000@news.povray.org>
In article <39b2fc70$1@news.povray.org>, "Thorsten Froehlich" 
<tho### [at] trfde> wrote:

> >     # a = a + 5
> 
> I have to admit, I kind of like this idea ... and it does not add a
> additional symbol to the scene language.

I think it would be possible by adding a boolean "Modify_Only" parameter 
to the Parse_Declare() function(to tell it whether to create a new 
variable or give an error if given an undefined symbol), and add a call 
to Parse_Declare() here, replacing the "UNGET EXIT" that is there now:

    OTHERWISE
       Parse_Declare(TRUE);
    END_CASE
  END_EXPECT

Most of the same code from the #set patch could be reused for this, for 
modifying the most local variable, just check the Modify_Only parameter 
instead of the token.
I just finished making these modifications, I haven't tested it yet 
though...it might blow up in my face.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Tony[B]
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 3 Sep 2000 22:21:30
Message: <39b3072a@news.povray.org>
There are programming languages like this out there? <shudder>


Post a reply to this message

From: Chris Huff
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 3 Sep 2000 22:59:48
Message: <chrishuff-0F96DD.22012703092000@news.povray.org>
In article <chrishuff-9358DC.21074603092000@news.povray.org>, Chris 
Huff <chr### [at] maccom> wrote:

> I think it would be possible by...

Well, it isn't that easy. :-(
I will take a closer look, but I don't really understand much of the 
parser code.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.