POV-Ray : Newsgroups : povray.beta-test : v3.8. Other than macro use of optional feature? : v3.8. Other than macro use of optional feature? Server Time
27 Feb 2024 14:32:32 EST (-0500)
  v3.8. Other than macro use of optional feature?  
From: William F Pokorny
Date: 25 Oct 2023 09:38:13
Message: <65391a45$1@news.povray.org>
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 
included 'optional'.

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.

Bill P.


Post a reply to this message

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