POV-Ray : Newsgroups : povray.advanced-users : Macros acting strange : Re: Macros acting strange Server Time
30 Jul 2024 04:11:51 EDT (-0400)
  Re: Macros acting strange  
From: Warp
Date: 29 Mar 2000 04:07:15
Message: <38e1c7c3@news.povray.org>
You have to remember that a macro is _not_ a function. A macro is a
substitution string. The body if the macro is inserted in the place of
the call as-is.
  So, for example this:

#macro Sum(X, Y)
  X+Y
#end

#declare result = 2*Sum(3,4);

will result in:

#declare result = 2*3+4;

  The right way of doing the macro is, of course:

#macro Sum(X, Y)
  (X+Y)
#end

  Now the result will be:

#declare result = 2*(3+4);

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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