Is anyone using the v3.8 'optional' feature for more than macro arguments?
On looking at deprecated, global and local keywords of late, my eye
caught code related to 'optional' where I didn't expect it.
I was only aware of (or only remember) the macro usage, but it's
supported more broadly - and since June 2015! I found a
'news-submissions post from clipka announcing new features which
Not sure what all of it works today. Some things mentioned there that
I've tried no longer function, while some do. I have gotten to trying
everything mentioned. Not have I tried to work out from the code the
more complicated ways 'optional' might be used.
This kind of thing does work:
// #declare Z = "gack\n";
#declare optional A = Z;
#local optional deprecated B = Z;
Any extended use of optional will complicate the question as to whether
some word is a defined identifier - it might not be until something
else, or some chain of something 'elses' is defined.
A and B are not (by the immediately following lines of code at least)
considered defined with the declare of Z commented.
My initial thought is the extended use is not all that useful and it
opens up ways for very confusing things to happen on editing scenes.
However, there is a dictionary form, and one with tuple assignments in
the news post. Those might be useful - but I've not tested what of those
forms are working in v3.8.
Post a reply to this message