POV-Ray : Newsgroups : povray.general : #local access : Re: #local access Server Time
8 Aug 2024 10:24:13 EDT (-0400)
  Re: #local access  
From: Rune
Date: 3 Mar 2001 16:01:46
Message: <3aa15bba@news.povray.org>
"Chris Huff" wrote:
> My objection is simply to #declare modifying variables created
> by #local.

What exactly is your objection based on? As it is now it will almost always
work as the user expects, without the user having to think too much about
it.

> Maybe a new #global keyword would be the best choice...
> #global Foo = bar;
> would create a global variable named Foo or modify an existing
> global variable with that name, and
> #local Foo = Foo + global(Foo);
> would add a local Foo to the global Foo. (assigning the result
> to the local version, of course)

When working with include files and macros created by other people, it is
very useful that using #local prevents these from interfering with each
other and with your own code if they by chance happens to use some of the
same variable names.

However, there is no point in intentionally to assign variables at different
levels with the same names. That was never the intention, if I have
understood correctly. Use different variable names instead.

For that reason it would not be logical to make features which would
specifically allow the user to working with several similarly named
variables at the same time. No need to make things more complicated than
necessary.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 28)
/ Also visit http://www.povrayusers.org


Post a reply to this message

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