POV-Ray : Newsgroups : povray.unofficial.patches : My personal wishlist : Re: My personal wishlist Server Time
2 Sep 2024 20:19:41 EDT (-0400)
  Re: My personal wishlist  
From: Nathan Kopp
Date: 26 Feb 2000 16:12:36
Message: <38b841c4@news.povray.org>
Chris Huff <chr### [at] yahoocom> 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

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