POV-Ray : Newsgroups : povray.beta-test : v3.8. Other than macro use of optional feature? Server Time
2 May 2024 16:20:08 EDT (-0400)
  v3.8. Other than macro use of optional feature? (Message 1 to 2 of 2)  
From: William F Pokorny
Subject: v3.8. Other than macro use of optional feature?
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

From: Bald Eagle
Subject: Re: v3.8. Other than macro use of optional feature?
Date: 25 Oct 2023 15:30:00
Message: <web.65396c7a357516f61f9dae3025979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

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

Yes, I remember that exact post - but I don't remember the application to
arrays!
Thanks for bumping that.


http://news.povray.org/povray.news-submissions/thread/%3C558b4c09%241%40news.povray.org%3E/

That could certainly be useful - you're certainly giving the parser a workout
with some interesting test cases   :O

- BW


Post a reply to this message

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