POV-Ray : Newsgroups : povray.general : paramters of macros (POV-Ray 3.1 bug?) : paramters of macros (POV-Ray 3.1 bug?) Server Time
13 Aug 2024 17:24:46 EDT (-0400)
  paramters of macros (POV-Ray 3.1 bug?)  
From: Friedemann Schmidt
Date: 15 Jul 1998 22:01:43
Message: <35ad50e7.4530171@news.povray.org>
Hi,

if I declare a macro like

  #macro Macro(A)
    #declare A = A + 1;
  #end

or

  #macro Macro(A)
    #local A = A + 1;
  #end
    
and call it like

  #declare X = 1;
  Macro(X)

X cahnges to 2. That's like calling a function in C by reference.

The documentation (page 106) says:

"When the macro is invoked, a new local symbol table is created. The
actual parameters are assigned to formal parameter identifiers as
local, temporary variables. POV-Ray jumps to the body of the macro and
continues parsing until the matching #end directive is reached. There,
the local variables created by the parameters are destroyed as well as
any local identifiers expressly created in the body of the macro."

I think, this is a contradiction to the effect above.

Does anyone know if it's a bug or didn't I understand the
documentation right?

Thanks in advance,
Friedemann


Friedemann Schmidt
Fri### [at] Stonescom
Raytracing-Gallery: http://www.rz.fhtw-berlin.de/~s0049669


Post a reply to this message

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