POV-Ray : Newsgroups : povray.unofficial.patches : Retaining persistent variables in MegaPov 1.0 : Re: Retaining persistent variables in MegaPov 1.0 Server Time
4 Jul 2024 20:33:03 EDT (-0400)
  Re: Retaining persistent variables in MegaPov 1.0  
From: Christopher James Huff
Date: 15 Oct 2003 15:39:10
Message: <cjameshuff-AF6B4D.15365315102003@netplex.aussie.org>
In article <3f8d9708@news.povray.org>,
 "David Wallace" <dar### [at] earthlinknet> wrote:

> In C/C++ persistent external variables are declared as static.  Since static
> is not a reserved word in POV (I checked) that should be the name of a
> variable that persists from frame to frame in an animation:
> 
> #static Fwd = 203.4;

I think the static keyword is one of the worst misfeatures of C/C++. 
Retained, indestructible, invariable, permanent, safe...I think 
"persistent" is really the best word for this.

How about this: deprecate #declare, and have #global declare a global 
persistent variable. Use #local to declare local variables, and #set to 
modify existing variables. Most variables should be local anyway, except 
for those in includes. This fixes several problems with the existing 
system. If non-persistent global variables turn out to be useful often 
enough, add something like #transient or #temporary to avoid the need to 
undefine them. (I don't think this will be necessary.)

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

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