POV-Ray : Newsgroups : povray.unofficial.patches : #let keyword(was: Previews of Ice Planet...) Server Time
2 Sep 2024 08:12:54 EDT (-0400)
  #let keyword(was: Previews of Ice Planet...) (Message 1 to 10 of 35)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Chris Huff
Subject: #let keyword(was: Previews of Ice Planet...)
Date: 30 Aug 2000 11:54:53
Message: <chrishuff-37B8CF.10562630082000@news.povray.org>
In article <chrishuff-AF5968.09493830082000@news.povray.org>, Chris 
Huff <chr### [at] maccom> wrote:

> Well, I guess I was wrong!
> BTW, I think I just figured out how to implement it, just have to 
> compile and test it...

I just finished implementing the #set keyword. It works perfectly: it 
modifies the most recently created version of a variable, but if given a 
variable that doesn't yet exist, it produces an error. It works properly 
with local variables, modifying the "most local" one.

Basically, instead of:
#declare J=0;
#while(J<10)
    #declare J=J+1;
#end

you would use:
#declare J=0;
#while(J<10)
    #set J=J+1;
#end

One place this is useful is if you make a typing mistake, like this:
#declare MyCounter=0;
#while(MyCounter<10)
    #declare MyCountr = MyCounter+1;
#end
This would normally cause an infinite loop, and may take a while to 
track down, especially in complex scenes and with typos that "look 
right" at a glance. If #set was used, it would cause an error ("#set 
cannot assign to uninitialized identifier MyCountr.") at that line, 
pointing you directly at the problem.

Another thing is that it makes it more visually clear where variables 
are *created*, and where they are only *changed*.
And it is less typing. ;-)

I will post the code for this patch in these newsgroups soon.

-- 
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: ryan constantine
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 30 Aug 2000 13:54:37
Message: <39AD4A5D.5EE8EFA1@yahoo.com>
hey, that's pretty clever.

Chris Huff wrote:
> 
> In article <chrishuff-AF5968.09493830082000@news.povray.org>, Chris
> Huff <chr### [at] maccom> wrote:
> 
> > Well, I guess I was wrong!
> > BTW, I think I just figured out how to implement it, just have to
> > compile and test it...
> 
> I just finished implementing the #set keyword. It works perfectly: it
> modifies the most recently created version of a variable, but if given a
> variable that doesn't yet exist, it produces an error. It works properly
> with local variables, modifying the "most local" one.
> 
> Basically, instead of:
> #declare J=0;
> #while(J<10)
>     #declare J=J+1;
> #end
> 
> you would use:
> #declare J=0;
> #while(J<10)
>     #set J=J+1;
> #end
> 
> One place this is useful is if you make a typing mistake, like this:
> #declare MyCounter=0;
> #while(MyCounter<10)
>     #declare MyCountr = MyCounter+1;
> #end
> This would normally cause an infinite loop, and may take a while to
> track down, especially in complex scenes and with typos that "look
> right" at a glance. If #set was used, it would cause an error ("#set
> cannot assign to uninitialized identifier MyCountr.") at that line,
> pointing you directly at the problem.
> 
> Another thing is that it makes it more visually clear where variables
> are *created*, and where they are only *changed*.
> And it is less typing. ;-)
> 
> I will post the code for this patch in these newsgroups soon.
> 
> --
> 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: Chris Huff
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 30 Aug 2000 14:17:19
Message: <chrishuff-9A1BB6.13185230082000@news.povray.org>
In article <39AD4A5D.5EE8EFA1@yahoo.com>, ryan constantine 
<rco### [at] yahoocom> wrote:

> hey, that's pretty clever.

Thanks! I just finished posting the source code to povray.programming.

-- 
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: 30 Aug 2000 19:01:27
Message: <39ad9246@news.povray.org>
Looks like a nice feature.

-- 
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: Tony[B]
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 31 Aug 2000 17:13:47
Message: <39aeca8b@news.povray.org>
I don't like the keyword, but the concept is alright! :)


Post a reply to this message

From: Chris Huff
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 31 Aug 2000 17:54:36
Message: <chrishuff-D4F6A6.16561131082000@news.povray.org>
In article <39aeca8b@news.povray.org>, "Tony[B]" 
<ben### [at] panamac-comnet> wrote:

> I don't like the keyword, but the concept is alright! :)

Which keyword? #let, or #set?
The post you replied to shouldn't even exist, since I told my software 
to cancel it, and claimed to have done so, then I reposted with #set in 
the subject...and can't find that post. It seems to have gone to data 
heaven...stupid program.

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).

#modify? My second choice, but already used in another patch, I think. 
It has a similar length to #local and #declare, which could make it more 
easily mistaken for them, but is the most precise of the keywords I came 
up with.

#assign? It is less precise than #modify, and it is the same length.

#let? See my explanation above, used in BASIC to create a variable, 
which is what the #declare and #local keywords already do. It is also a 
bit more vague, but it is nice and short.

#make? #change? #mutate? Too imprecise, obtuse, vague, and/or sometimes 
used for other, entirely different things on computers.

Any better suggestions?

-- 
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: Tom Melly
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 1 Sep 2000 04:12:03
Message: <39af64d3@news.povray.org>
"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-D4F6A6.16561131082000@news.povray.org...


> ....
> Any better suggestions?
>

#update ? (bit long)


Post a reply to this message

From: Chris Huff
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 1 Sep 2000 13:03:15
Message: <chrishuff-9498EE.12045201092000@news.povray.org>
In article <39af64d3@news.povray.org>, "Tom Melly" <tom### [at] tomandlucouk> 
wrote:

> #update ? (bit long)

No offense, but yuck. :-)
It just doesn't seem to describe it well enough...and just doesn't seem 
to sound right for this feature.
I think the best keyword would be #modify, but it is already used, and 
the two uses may not interact well with each other.

-- 
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: Psychomek
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 2 Sep 2000 00:10:56
Message: <39B07FAC.5A6EB39@home.com>
what about #mod or #fix?

Chris Huff wrote:

> In article <39af64d3@news.povray.org>, "Tom Melly" <tom### [at] tomandlucouk>
> wrote:
>
> > #update ? (bit long)
>
> No offense, but yuck. :-)
> It just doesn't seem to describe it well enough...and just doesn't seem
> to sound right for this feature.
> I think the best keyword would be #modify, but it is already used, and
> the two uses may not interact well with each other.
>
> --
> 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: Chris Huff
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 2 Sep 2000 07:31:17
Message: <chrishuff-19B162.06325502092000@news.povray.org>
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

Goto Latest 10 Messages Next 10 Messages >>>

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