POV-Ray : Newsgroups : povray.beta-test : semicolon not expected : Re: semicolon not expected Server Time
30 Jul 2024 10:13:56 EDT (-0400)
  Re: semicolon not expected  
From: Mike Williams
Date: 7 Jan 2002 17:49:16
Message: <jkJfWHAWefO8EwOg@econym.demon.co.uk>

>On Mon, 07 Jan 2002 13:18:44 +0100, "Thorsten Froehlich" <tho### [at] trfde>
>wrote:
>> Semicolons are listed as required after every #local, #declare and #version
>> with a float, vector or color value.  If you don't include the required
>> semicolon the problem is in your scene and the parser reports it as soon as
>> it is possible to report this.
>
>I think you misunderstand my report so I post shorter example:
>
>#macro Test2() #if(yes) 2 #end #end
>#local F=Test2();
>
>note: there is semicolon but parser expects object or directive

But POV macros behave as if they were *macros* not functions.

If POV macros behaved like *functions* then Test2() would return the
value "2". "2" is a float, so you'd expect a semicolon to be
permissible.

Since POV macros behave like *macros*, Test2() behaves as if it returns
the code "#if(yes) 2 #end".


So 
        #macro Test2() #if(yes) 2 #end #end
        #local F=Test2();
behaves like the illegal statement
        #local F=#if(yes) 2 #end;


Note that this is legal:
        #macro Test2() (#if(yes) 2 #end) #end
        #local F=Test2();
Because that behaves like the legal statement
        #local F=(#if(yes) 2 #end);

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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