POV-Ray : Newsgroups : povray.general : Problem with parameters : Re: Problem with parameters Server Time
31 Jul 2024 06:21:59 EDT (-0400)
  Re: Problem with parameters  
From: Warp
Date: 29 Feb 2008 11:07:54
Message: <47c82dd9@news.povray.org>
Tim Attwood <tim### [at] comcastnet> wrote:
> We could add a specific return command for passing values
> by parameter...

> #macro foobar(A, B)
>    #return A = foo;
>    #return B = bar;
> #end

  I have a much simpler suggestion: If you don't want to modify an identifier
given as parameter, don't assign anything to it. It's that simple.

  If you need a copy of the identifier, then copy it:

#macro foobar(A)
{
  #local LocalCopyOfA = A;
  ...
}

  No need to make the SDL parser any more complicated than it already is.

-- 
                                                          - Warp


Post a reply to this message

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