|
![](/i/fill.gif) |
Chris Huff <chr### [at] yahoo com> wrote...
> This is true...maybe types aren't such a good idea, even though they
> would be useful in some of the more complex include files and scenes.
> However, I would like to see #declare and #local only be used to
> *create* variables, with either another keyword(#let?) or no keyword at
> all required to modify a variable, something like:
> #declare K=0;// creates a variable K
> #let K=K+1;// adds 1 to the variable K
> K=K+1;// adds 1 to the variable K
> This would make a lot of the includes easier to read and maintain, and
> would make debugging easier, since it is clearer where a variable is
> first created.
Personally, I disagree. For non-compiled, scripting languages, I like
features such as automatic variable creation and run-time scoping.
I don't like #declare and #local. I like $ and % instead. ;-)
$k=0;
$k=k+1;
Run-time scoping, loose variable types, and automatic creation of variables
are 'features' of scripting languages. This is different from compiled
procedural languages, but 'different' does not necessarily mean 'wrong'.
Finally, because of the way POV's scene-description language is defined,
your example of the assignment with neither #declare or #let would probably
cause ambiguity in the parser, and fixing that would likely lead to
backwards compatibility issues.
See p.t.s-f for an example of run-time scoping.
-Nathan
Post a reply to this message
|
![](/i/fill.gif) |