POV-Ray : Newsgroups : povray.general : #version directive : Re: #version directive Server Time
30 Jun 2025 18:38:21 EDT (-0400)
  Re: #version directive  
From: Bald Eagle
Date: 8 Feb 2018 10:20:01
Message: <web.5a7c6a73c5234a59c437ac910@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> clipka <ano### [at] anonymousorg> wrote:
>
> >
> > If you want your scene to automatically adapt to whatever version is
> > used, it is recommended to use
> >
> >     #version version;
> >
> > as the first line and continue from there.
>
> I didn't realize this, even after re-reading the docs; the combination of the
> #version directive and  version keyword has always been a little mysterious to
> me. So, no matter what version of POV-Ray I'm using (or what version my scene
> was originally written with), if I use
>
> #version version
>
> then the scene file will automatically be processed *as if* it was written in
> the currently-running POV-Ray version? (I hope I'm being clear.)

Essentially, yes.
I think that the term keyword blurs certain things, and would like to see a
change to something more descriptive _like_ "POV-Ray reserved constant."

>Disregarding
> any compatibility problems that might arise, of course, if the scene file is an
> old one. In other words, if I'm currently using a specific v3.7.1 beta, then
>
> #version version
> is basically a 'shorthand' way of specifying
>
> #version 3.71;
>
> ?

Again, yes.
The thing to do would be to write a short SDL script that sends the value of
version to the debug stream.
Then do #version 3.5, do #version version again, and see what version equals.
In that case, if version winds up being 3.5, then version is a "POV-Ray
predefined variable", rather than a constant that reflects the version of the
build.

Perhaps there ought to be a secondary "software_version" or "current_version"
constant that immutably reflects the software version.

> The thing is, the docs say this:
> "As of version 3.7, there has been a requirement implemented. In order to obtain
> full version 3.7 functionality, you MUST specify the #version 3.7".  Or 3.71,
> etc. But there, it doesn't mention the   #version version   trick (or rather,
> the short explanation is not totally clear that it can be used instead.)

Right, well, there's kind of a lot of that in the docs.

> Also, this:
> "...and a CHANGE as of POV-Ray 3.7.1 or later it is now considered an outright
> error to use #version 3.71 or higher in a main scene file that does not start
> with a #version directive."
>
> Maybe it's just me, but that sounds confusing. "#version 3.71" is in GREEN there
> (like the other keywords used in those paragraphs), but is it meant to be? I'm
> wondering if the sentence is actually trying to say something like this:
>
> "...and a CHANGE as of POV-Ray 3.7.1 or later it is now considered an outright
> error to run a scene file in v3.7.1 or higher that does not start with a
> #version directive."  ??

I do believe you are correct, and that should be changed.

> And continuing... (the forward slashes are mine):
> "If you do need to do some processing /before you decide/ on a version
> compatibility option, start your scene with the following construct:
>   #version version;
>
> That could possibly be interpreted as meaning a 'real' #version number needs to
> be added later in the scene.

Well, version is a "real" version number, it may just not be the desired one, or
one appropriate for correctly parsing a section of the SDL.

> If I'm wrong about any of this, I apologize for possibly confusing the issue
> further ;-)


The real trick here would be to somehow summarize WHY you'd want to specify an
earlier version, and list all of the directives that are "parsed / interpreted /
executed differently" depending on the version specified.

Ugh.


Post a reply to this message

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