|
|
In article <Xns### [at] netplexaussieorg>,
ingo <ing### [at] tagpovrayorg> wrote:
> >> #J = J + 1;
> > I like this syntax for manipulating already declared variables.
>
> Why not throw the # away completely?
>
> J = 0;
> J = J + 1;
>
> Everything is local, unless it is declared global,
>
> #global J = "global"
Ew. There's no way of telling a declaration apart from an assignment,
unless it's global. You just completely broke the main benefits of my
suggested method. Look at this code:
J = 0;
#while(J < 10)
j = J + 1;
#end
That's an infinite loop. This isn't, it's an error:
#def J = 0;
#while(J < 10)
#j = J + 1;
#end
This would also be harder to parse, and would break consistency with the
rest of the language. I'd actually prefer something like this:
def J = 0;
while(J < 10) {
J = J + 1;
}
or at least:
def J = 0;
while(J < 10)
J = J + 1;
end
But you'd have to redesign the language and completely redo the parser.
What I suggested only requires 3 small additions.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/
Post a reply to this message
|
|