POV-Ray : Newsgroups : povray.general : object oriented features : Re: object oriented features Server Time
28 Jul 2024 16:27:57 EDT (-0400)
  Re: object oriented features  
From: Chris Huff
Date: 20 Aug 2000 00:48:59
Message: <chrishuff-060105.23501719082000@news.povray.org>
In article <01c00a5c$cc13e9e0$8e7889d0@daysix>, "H. E. Day" 
<Pov### [at] aolcom> wrote:

> Umm...  Chris, you can already modify existing variables.
> #declare A = 435435/2423423^23
> //Varia code
> #declare A=A+anythingyouwant.
> 
> Or did you mean something else?

I mean something else, I know you can modify variables. :-)
#set would *only* modify existing variables, if you tried to #set a 
nonexistant identifier, an error would be produced. I have sometimes had 
a simple typo produce an entirely new variable when I was trying to 
modify an existing one, using #set would have prevented that bug(since 
an error would have been produced identifying the code which would cause 
a problem).
Basically, #declare and #local would create variables(and behave exactly 
as they do now, preserving backwards compatibility), #set would modify 
the most local variable with the given name. It would make easier to 
read scene code(it makes it obvious where the variable is created and 
where it is only modified) and find bugs.
It shouldn't be difficult to do, but I can't make much sense of the 
parsing code.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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