![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <chrishuff-AF5968.09493830082000@news.povray.org>, Chris
Huff <chr### [at] mac com> 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] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: ryan constantine
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 30 Aug 2000 13:54:37
Message: <39AD4A5D.5EE8EFA1@yahoo.com>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
hey, that's pretty clever.
Chris Huff wrote:
>
> In article <chrishuff-AF5968.09493830082000@news.povray.org>, Chris
> Huff <chr### [at] mac com> 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] mac com, http://homepage.mac.com/chrishuff/
> TAG: chr### [at] tag povray org, http://tag.povray.org/
>
> <><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <39AD4A5D.5EE8EFA1@yahoo.com>, ryan constantine
<rco### [at] yahoo com> wrote:
> hey, that's pretty clever.
Thanks! I just finished posting the source code to povray.programming.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I don't like the keyword, but the concept is alright! :)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <39aeca8b@news.povray.org>, "Tony[B]"
<ben### [at] panama c-com net> 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] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Tom Melly
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 1 Sep 2000 04:12:03
Message: <39af64d3@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Chris Huff" <chr### [at] mac com> wrote in message
news:chrishuff-D4F6A6.16561131082000@news.povray.org...
> ....
> Any better suggestions?
>
#update ? (bit long)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <39af64d3@news.povray.org>, "Tom Melly" <tom### [at] tomandlu co uk>
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] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Psychomek
Subject: Re: #let keyword(was: Previews of Ice Planet...)
Date: 2 Sep 2000 00:10:56
Message: <39B07FAC.5A6EB39@home.com>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
what about #mod or #fix?
Chris Huff wrote:
> In article <39af64d3@news.povray.org>, "Tom Melly" <tom### [at] tomandlu co uk>
> 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] mac com, http://homepage.mac.com/chrishuff/
> TAG: chr### [at] tag povray org, http://tag.povray.org/
>
> <><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <39B### [at] home com>, Psychomek <psy### [at] home com>
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] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |