POV-Ray : Newsgroups : povray.general : printing object's identifier : Re: printing object's identifier Server Time
18 May 2024 16:52:39 EDT (-0400)
  Re: printing object's identifier  
From: clipka
Date: 20 Mar 2016 19:47:15
Message: <56ef3683$1@news.povray.org>
Am 19.03.2016 um 22:25 schrieb Bald Eagle:

> More practical though, would be a shorthand method for #declaring lots of
> variables.  I was trying to think about a way to do something like:
> #declare a=1; b=2; c=3; d=4; ...   and this seems to be the way to accomplish
> that.   Either through a loop, or by just arranging the variable names and
> values in an array.   That cuts out a ton of hand-typed #declares.

How about

    #declare (a,b,c,d) = (1,2,3,4);

Besides serving as shorthand for multiple declares, it comes with two
extra benefits that your suggestion doesn't provide:

- The values are grouped together, separate from the list of
identifiers, so that the values can be generated by a single macro
invocation, allowing a macro to return a set of values:

    #macro MyMacro()
        (1,2,3,4)
    #end

    #declare (a,b,c,d) = MyMacro()

- It is already implemented in the current 3.7.1-alpha ;)


Post a reply to this message

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