|
|
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
|
|