POV-Ray : Newsgroups : povray.newusers : Any more characters in declared names possible ? Server Time
1 Nov 2024 02:17:40 EDT (-0400)
  Any more characters in declared names possible ? (Message 1 to 6 of 6)  
From: Mr
Subject: Any more characters in declared names possible ?
Date: 16 Apr 2011 12:25:00
Message: <web.4da9c23e311bb397128f47250@news.povray.org>
Hi,
working on the blender exporter, I came across some troubles when using
characters such as hyphens or dots in declared names. Is this restriction
usefull or could it be removed in later versions of POV-Ray ?


Post a reply to this message

From: Jim Holsenback
Subject: Re: Any more characters in declared names possible ?
Date: 16 Apr 2011 15:00:39
Message: <4da9e757$1@news.povray.org>
On 04/16/2011 01:22 PM, Mr wrote:
> Hi,
> working on the blender exporter, I came across some troubles when using
> characters such as hyphens or dots in declared names. Is this restriction
> usefull or could it be removed in later versions of POV-Ray ?
>
>
Not for certain, but the "dot" restriction may be in place for the case 
of a vector identifier ... there are a whole slew of operators that may 
apply ... just one example:

#declare Point = <5,10,0>;
object { Whatever translate Point.y }


Post a reply to this message

From: Alain
Subject: Re: Any more characters in declared names possible ?
Date: 16 Apr 2011 15:39:05
Message: <4da9f059@news.povray.org>

> Hi,
> working on the blender exporter, I came across some troubles when using
> characters such as hyphens or dots in declared names. Is this restriction
> usefull or could it be removed in later versions of POV-Ray ?
>
>

The hyphen will be interpreted as a minus sign.
If you have something like:
#declare A-B = 5;
#declare A = 1;
#declare B = 2;

Then you'll have a problem with this:

translate <A, B, A-B> been interpreted as translate<1,2,-1>

You have no way to diferensiate between A-B (the variable) and A-B (A 
minus B)


The same way, you can't use any of those in a name:
|!&*/+-.^=%"'@#\(){}[]<>



Alain


Post a reply to this message

From: Mr
Subject: Re: Any more characters in declared names possible ?
Date: 20 Apr 2011 09:25:00
Message: <web.4daede8cc669e4df9a3b5fd00@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:

>
> The same way, you can't use any of those in a name:
> |!&*/+-.^=%"'@#\(){}[]<>


Thanks, this will allow a more complete fix when I get the time.


Post a reply to this message

From: clipka
Subject: Re: Any more characters in declared names possible ?
Date: 9 May 2011 05:18:59
Message: <4dc7b183$1@news.povray.org>
Am 20.04.2011 15:24, schrieb Mr:
> Alain<aze### [at] qwertyorg>  wrote:
>
>>
>> The same way, you can't use any of those in a name:
>> |!&*/+-.^=%"'@#\(){}[]<>
>
>
> Thanks, this will allow a more complete fix when I get the time.

As a matter of fact, current versions of POV-Ray support only latin 
upper- and lowercase letters (a-z, A-Z), underscore (_), and digits 
(0-9). The latter cannot be used as first character of an identifier. As 
for ASCII characters, it is unlikely that any other characters will ever 
be added to the list of allowed identifier characters (unless some 
special syntax would be added to support truly arbitrary identifier 
names); As for non-ASCII Unicode characters, I currently wouldn't place 
any bets either way.


Post a reply to this message

From: Warp
Subject: Re: Any more characters in declared names possible ?
Date: 9 May 2011 12:31:17
Message: <4dc816d5@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> As a matter of fact, current versions of POV-Ray support only latin 
> upper- and lowercase letters (a-z, A-Z), underscore (_), and digits 
> (0-9). The latter cannot be used as first character of an identifier. As 
> for ASCII characters, it is unlikely that any other characters will ever 
> be added to the list of allowed identifier characters (unless some 
> special syntax would be added to support truly arbitrary identifier 
> names); As for non-ASCII Unicode characters, I currently wouldn't place 
> any bets either way.

  Technically UTF-8-encoded (non-ASCII) characters in identifier names
shouldn't be a problem because the encoding has been specifically
designed so that they won't (iow. no byte in a multi-byte character
will be a control character, a space, etc. if interpreted in ASCII).
It's just a question of the parser allowing for them.

-- 
                                                          - Warp


Post a reply to this message

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