POV-Ray : Newsgroups : povray.unofficial.patches : MegaPOV quirks and questions.. : Re: MegaPOV quirks and questions.. Server Time
2 Sep 2024 06:13:35 EDT (-0400)
  Re: MegaPOV quirks and questions..  
From: Alex Vandiver
Date: 25 Jul 2000 12:38:47
Message: <397DED25.FBFE4C6C@tiac.net>
Ron Parker wrote:
> Something like this would be, though:
> 
> #macro a(foo)
>   #declare Switch=foo;
> #end
> 
> #macro b()
>   #if (Switch)
>     // do one thing
>   #else
>     // do another thing
>   #end
> #end

Yes, that would work -- though it would have a large impact on parsing
time in the case of the spline include, where b() is called once for
every segment of the spline.  But what I'm wondering is if we need to
use this workaround -- so far I've not heard anyone explain WHY nested
calls are explicitly outlawed in MegaPOV.  If the official verion can do
it, why can't Mega?  Especially if, as Ron says (and I agree), the
nested macro calls are "cleaner"?  If there was no reason from the
parsing standpoint to limit nested macros, and it was merely to coerce
people to unroll them, then perhaps a warning rather than an error would
be more appropriate?
-Alex V.


Post a reply to this message

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