POV-Ray : Newsgroups : povray.beta-test : Syntax extension: Passing multiple values out of a macro : Re: Syntax extension: Passing multiple values out of a macro Server Time
9 May 2024 20:23:51 EDT (-0400)
  Re: Syntax extension: Passing multiple values out of a macro  
From: Mike Horvath
Date: 17 Jan 2016 19:15:55
Message: <569c2ebb$1@news.povray.org>
On 2/28/2015 8:51 PM, clipka wrote:
> I've just implemented a syntax extension that you might like: As of the
> newest development version, you'll now be able to assign multiple
> variables with a single #declare (or #local) statement, like so:
>
>    #declare (A,B,C) = (X,Y,Z);
>
> Obviously, this now allows for a single macro to return multiple items,
> like this:
>
>    #macro WindowFrameAndCutout(Pos,H,W)
>      #local Frame  = union {...};
>      #local Cutout = box {...};
>      (Frame,Cutout,Area)
>    #end
>
>    #declare (MyFrame,MyCutout) = WindowFrameAndCutout(...);
>
> How's that? :D

I don't think you should use parentheses. A comma between each parameter 
should suffice.

For instance in Lua you can do

a, b = 10, 2*x

Parentheses makes it look like a macro, which is confusing.


Post a reply to this message

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