POV-Ray : Newsgroups : povray.general : Let me get this straight--a local variable can't have the same name as a ma= : Re: Let me get this straight--a local variable can't have the same name as = Server Time
30 Jul 2024 18:13:35 EDT (-0400)
  Re: Let me get this straight--a local variable can't have the same name as =  
From: Warp
Date: 31 Aug 2008 13:44:23
Message: <48bad877@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> That shouldn't make a difference.  A local variable should override any and all
> global identifiers within its scope.  That is the very purpose of local
> variables: so different parts of a program need not be concerned about how the
> other parts do their jobs.  I maintain that having to avoid name collisions
> with the internal workings of external subprograms is totally unreasonable.
> It's the cyber-equivalent of having your lawn mower fail because it uses the
> same type of motor oil as your wife's car.

  The problem is that a #macro is *not* a function. It's much closer to
the substitution macros in a C preprocessor.

  When POV-Ray encounters a name, and this name has been declared as a
macro, it will start parsing that macro, substituting the name with the
contents of the macro.

  I'm not saying this is a good thing. I'm just saying how it works.
It might also require quite a lot of redesigning to change this (which
is exactly what POV-Ray 4 is for.)

-- 
                                                          - Warp


Post a reply to this message

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