POV-Ray : Newsgroups : povray.beta-test : semicolon not expected : Re: semicolon not expected Server Time
30 Jul 2024 10:21:52 EDT (-0400)
  Re: semicolon not expected  
From: Warp
Date: 7 Jan 2002 18:25:08
Message: <3c3a2e54@news.povray.org>
Mike Williams <mik### [at] nospamplease> wrote:
: But POV macros behave as if they were *macros* not functions.

  In fact, POV-Ray macros do not work like real substitution macros
(like the #defined macros in C).
  This:

    #macro A()
      #local a = 5;
    #end
    #local a = 6;
    A()

is *not* the same as:

    #local a = 6;
    #local a = 5;

  I think that at low-level the difference between pov-macros and C-macros
is that in the latter the macro body is truely placed in the place of the
macro call by the pre-compiler (and then the actual compiler sees just this
but has no knowledge of the original macro), while in POV-Ray the macro is
parsed where it is, without making a real substitution. The difference is
very tenuous and most of the time it has no effect, but in some cases it
has (like when you use #local identifiers inside the macro).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

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