POV-Ray : Newsgroups : povray.general : Request for enhancement Server Time
8 Aug 2024 16:21:11 EDT (-0400)
  Request for enhancement (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: =Bob=
Subject: Request for enhancement
Date: 2 Dec 2000 21:12:30
Message: <3a29ac0e@news.povray.org>
I'd really like it if PovRay had assignment operators,
so that it would know the difference between declaring
a variable and assigning a value to an existing one. It
would, in my case, signal a typo for the multitude of
variables used in some of my code. I like to declare
the default variables and then change them as needed
prior to calling macros.

#declare gl_XposAtMaxVelocity = 1.45;

later in the code:

#assign gl_XPosAtMaxVelocity = 2.00;

Then PovRay would check the existence of the previously
declared variable and issue a warning that the variable
does not exist. In the example above, I have a capital 'P'
where it should be lower case.

Currently, PovRay just creates the new variable and the
macro continues to use the old value and it's sometimes
difficult to find the error.

Just wishing...
Thanks again for making such a wonderful program!
=Bob=


Post a reply to this message

From: Chris Colefax
Subject: Re: Request for enhancement
Date: 2 Dec 2000 21:56:02
Message: <3a29b642@news.povray.org>
=Bob= <Bob### [at] threestrandscom> wrote:
> I'd really like it if PovRay had assignment operators,
> so that it would know the difference between declaring
> a variable and assigning a value to an existing one. It
> would, in my case, signal a typo for the multitude of
> variables used in some of my code. I like to declare
> the default variables and then change them as needed
> prior to calling macros.
>
> #declare gl_XposAtMaxVelocity = 1.45;
>
> later in the code:
>
> #assign gl_XPosAtMaxVelocity = 2.00;
>
> Then PovRay would check the existence of the previously
> declared variable and issue a warning that the variable
> does not exist. In the example above, I have a capital 'P'
> where it should be lower case.
>
> Currently, PovRay just creates the new variable and the
> macro continues to use the old value and it's sometimes
> difficult to find the error.

Why patch POV when you can do it with macros?:

#macro assign (Var, Value) #declare Var = Value; #end

Usage:

#declare gl_XposAtMaxVelocity = 1.45;
assign (gl_XposAtMaxVelocity, 2.00)

This should behave exactly as you want, issuing a warning when you try to
assign a value to a non-defined variable (and even showing you the mistyped
variable name!).

If you want to go one step further, you can create macros that allow you to
use named options with macro functions (so you don't have to declare/assign
all the options you want to use) - see my Spline Macro File at
http://www.geocities.com/ccolefax/spline for details.


Post a reply to this message

From: =Bob=
Subject: Re: Request for enhancement
Date: 2 Dec 2000 22:36:24
Message: <3a29bfb8@news.povray.org>
Hi Chris,

I was going to add in my post that a macro would
suffice to do the job, but I left it off as I was doing
three things at once. I do appreciate your solution
to my need, and will probably implement something
of the sort. It's just that it does puff up the code
quite a bit when you use hundreds of variables, and
the interpreter could do the job so much faster. Maybe
not as much as I think?

Thanks again, wishing you a wonderful evening!
=Bob=

"Chris Colefax" <chr### [at] tagpovrayorg> wrote in message
news:3a29b642@news.povray.org...

[My post and solution deleted]

: This should behave exactly as you want, issuing a warning when you try to
: assign a value to a non-defined variable (and even showing you the
mistyped
: variable name!).
:
: If you want to go one step further, you can create macros that allow you
to
: use named options with macro functions (so you don't have to
declare/assign
: all the options you want to use) - see my Spline Macro File at
: http://www.geocities.com/ccolefax/spline for details.
:
:


Post a reply to this message

From: Christoph Hormann
Subject: Re: Request for enhancement
Date: 3 Dec 2000 03:25:40
Message: <3A2A0385.3E05A9FD@gmx.de>
=Bob= wrote:
> 
> I'd really like it if PovRay had assignment operators,
> so that it would know the difference between declaring
> a variable and assigning a value to an existing one. It
> would, in my case, signal a typo for the multitude of
> variables used in some of my code. I like to declare
> the default variables and then change them as needed
> prior to calling macros.
> 

Chris Huff's Megapov Plus has a new #set directive that does exactly this
(it produces an error if used with a not declared identifier)

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: =Bob=
Subject: Re: Request for enhancement
Date: 3 Dec 2000 10:06:53
Message: <3a2a618d@news.povray.org>
Hi Christoph,

I just tried it and it works just like you said, that's
great! Do you know if this feature will be incorporated
into the next official release of PovRay?

Thanks again, have a great day!
=Bob=

"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3A2A0385.3E05A9FD@gmx.de...

[My previous post deleted]

: Chris Huff's Megapov Plus has a new #set directive that does exactly this
: (it produces an error if used with a not declared identifier)
:
: Christoph
:
: --
: Christoph Hormann <chr### [at] gmxde>
: IsoWood include, radiosity tutorial, TransSkin and other
: things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Christoph Hormann
Subject: Re: Request for enhancement
Date: 3 Dec 2000 11:22:16
Message: <3A2A7337.FDA1E19E@gmx.de>
=Bob= wrote:
> 
> Hi Christoph,
> 
> I just tried it and it works just like you said, that's
> great! Do you know if this feature will be incorporated
> into the next official release of PovRay?
> 
> Thanks again, have a great day!
> =Bob=
> 

I don't think so, it was developed quite lately (just like the displace
warp :-) and therefore won't make it to the official version AFAIK.

BTW the current list with new features in 3.5 is in povray.announce.f-a-q.
Subject: POV-Team Status Report - September 1, 2000

Christoph      

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Chris Huff
Subject: Re: Request for enhancement
Date: 4 Dec 2000 05:42:22
Message: <chrishuff-B26367.05430504122000@news.povray.org>
In article <3a29b642@news.povray.org>, "Chris Colefax" 
<chr### [at] tagpovrayorg> wrote:

> Why patch POV when you can do it with macros?:

Because you can't do this with macros? :-)
The #set directive works with both #declare and #local, and will be 
faster than calling a macro, not to mention looking better in the scene 
code...

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Chris Huff
Subject: Re: Request for enhancement
Date: 4 Dec 2000 05:46:36
Message: <chrishuff-DF6AD7.05471904122000@news.povray.org>
In article <3a2a618d@news.povray.org>, "=Bob=" <Bob### [at] threestrandscom> 
wrote:

> Do you know if this feature will be incorporated
> into the next official release of PovRay?

It won't be, it is too new. As Christoph Hormann mentioned, the feature 
list for 3.5 is in povray.announce.frequently-asked-questions.
It might make it into the next MegaPOV, whenever that comes out.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: =Bob=
Subject: Re: Request for enhancement
Date: 4 Dec 2000 09:03:14
Message: <3a2ba422@news.povray.org>
Thanks, Chris.

I checked out the list too. That's a feature that would
be rather nice to have. My only concern is making
something that can be used in all of the popular
versions. I guess that's not too easy.

Have a great day!
=Bob=

"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-DF6AD7.05471904122000@news.povray.org...
: In article <3a2a618d@news.povray.org>, "=Bob=" <Bob### [at] threestrandscom>
: wrote:
:
: > Do you know if this feature will be incorporated
: > into the next official release of PovRay?
:
: It won't be, it is too new. As Christoph Hormann mentioned, the feature
: list for 3.5 is in povray.announce.frequently-asked-questions.
: It might make it into the next MegaPOV, whenever that comes out.
:
: --
: Christopher James Huff
: Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
: TAG: chr### [at] tagpovrayorg, http://tag.povray.org/
:
: <><


Post a reply to this message

From: Ken
Subject: Re: Request for enhancement
Date: 4 Dec 2000 09:11:42
Message: <3A2BA6E1.8E54FEF4@pacbell.net>
Chris Huff wrote:
> 
> In article <3a29b642@news.povray.org>, "Chris Colefax"
> <chr### [at] tagpovrayorg> wrote:
> 
> > Why patch POV when you can do it with macros?:
> 
> Because you can't do this with macros? :-)

Careful ! Everytime I think something is impossible to do with
POV-Ray Mr. Colefax or Mr. Parker comes along and show just how
possible it really is :)

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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