POV-Ray : Newsgroups : povray.general : tau : Re: tau Server Time
16 Apr 2024 16:09:31 EDT (-0400)
  Re: tau  
From: clipka
Date: 14 Sep 2018 00:32:11
Message: <5b9b39cb$1@news.povray.org>
Am 14.09.2018 um 00:33 schrieb Bald Eagle:
> 
> I've been hopping between 3.7, and other later versions.

You shouldn't be doing that. Use either v3.7.0 (the latest official
stable release) or the most recent tagged v3.8.0-alpha (currently
v3.8.0-alpha.9811560).

Any versions in between are obsolete and no longer supported.

It's the nature of development versions that they're sill in flux, and
no attempt is made to maintain backward compatibility among them.

(Experimental versions such as the new parser are a bit of an exception,
but they too become obsolete over time.)

If you're using an unofficial patch based on some interim version of
POV-Ray, it should come with its own mechanism to detect what version of
the patch you are using, which you should use to infer what set of
official features it includes and which it doesn't.


That said...

> What is the best (most robust and reliable) way to determine if tau is defined,
> and if not, set it's value?

...
> #if (version < 3.8)
>  #ifndef (tau)
>     #declare tau = 2*pi;
>     #end
> #end
> 
> I get:
> 
> Parse Warning: Tried to test whether a reserved keyword is defined. Test result
> may not be what you expect.
> Parse Error: Expected 'undeclared identifier', float function 'tau' found
> instead

The canonical solution is to write your scene to conform to one
particular version, and use the `#version` directive to (A) enforce it
as the minimum version and (B) let any later version know that it should
behave in a backwards-compatible manner:

    #version 3.8;
    // make use of tau

or:

    #version 3.7;
    // don't even try to make tau work

Again note that what constitutes canonical behaviour of version 3.8 is
still in flux. Both the most recent v3.8.0-alpha as well as all recent
experimental versions support tau, so officially the above is safe.

The next best option is to make use of the new feature if it can be
determined for sure that it is supported, but if in doubt fall back to
an alternative that is safe for all versions; e.g.:

    #if (version >= 3.8)
        #declare Tau = tau;
    #else
        #declare Tau = 2*pi;
    #end
    // make use of Tau

Note the use of capitalized Tau, and the fact that even before the
introduction of the featurethe, the following would have been considered
NOT correct:

    #declare tau = 2*pi;

because that would have constituted a user-defined variable, which
should never use all-lowercase identifiers, specifically because they
might conflict with keywords in future versions.


Post a reply to this message

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