POV-Ray : Newsgroups : povray.beta-test : can't redefine identifier Server Time
2 Nov 2024 09:21:49 EDT (-0400)
  can't redefine identifier (Message 1 to 7 of 7)  
From:
Subject: can't redefine identifier
Date: 3 Jan 2002 10:11:07
Message: <tis83ugh1kcc22h5o6is9qpkv61pjgunc0@4ax.com>
POV 3.5 b 9 on PII 233 128 MB with NT 4 Sp 6

I'm surprised below doesn't work:

#declare C=function{x+y+z};
#declare C=10;
#declare C=function{x+y+z};
Parse Error: Attempted to redefine float identifier as function_id.

#declare C=function{x+y+z};
#declare C=array[10];
#declare C=function{x+y+z};
Parse Error: Attempted to redefine array identifier as function_id.

#declare C=function{x+y+z};
#declare C="S";
#declare C=function{x+y+z};
Parse Error: Attempted to redefine string identifier as function_id.

but below works fine

#declare C=function{x+y+z};
#declare C=function{x};
#declare C=function{x+y+z};

Is it temporary workaround of some bug or final solution? If final then there
isn't any note about it in documentation.

ABX


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: can't redefine identifier
Date: 3 Jan 2002 10:46:59
Message: <3c347cf3@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> Is it temporary workaround of some bug or final solution? If final then there
> isn't any note about it in documentation.

Redeclaring functions is not allowed.  Unfortunately the parser doesn't
always seem to catch every attempt to do so.  Log this as a bug.  Expected
behavior is always (the same) error message.

The only "legal" way to redeclare a function is to undef it first.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From:
Subject: Re: can't redefine identifier
Date: 3 Jan 2002 10:58:36
Message: <ilv83u4pd05sm9mle1vhvoqkrofqts9kkl@4ax.com>
On Thu, 03 Jan 2002 16:46:13 +0100, "Thorsten Froehlich" <tho### [at] trfde>
wrote:

> Redeclaring functions is not allowed.

So documentation needs update in this subject.
But note I'm not redeclaring function in below two lines!

#declare C=10;
#declare C=function{x+y+z};

ABX.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: can't redefine identifier
Date: 3 Jan 2002 13:32:01
Message: <3c34a3a1@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> So documentation needs update in this subject.
> But note I'm not redeclaring function in below two lines!
>
> #declare C=10;
> #declare C=function{x+y+z};

True, the check only works by looking if the variable name is redeclared.
While it was by design, if the check doesn't work this can probably be
improved as well when fixing the checking of redeclared functions.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Warp
Subject: Re: can't redefine identifier
Date: 3 Jan 2002 18:25:20
Message: <3c34e860@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
: The only "legal" way to redeclare a function is to undef it first.

  Wouldn't it be possible for the parser to automatically undef the function
when it's attempted to redeclare, and the declare it with the new function?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: can't redefine identifier
Date: 3 Jan 2002 22:02:13
Message: <3c351b35@news.povray.org>
In article <3c34e860@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   Wouldn't it be possible for the parser to automatically undef the function
> when it's attempted to redeclare, and the declare it with the new function?

It would, but the requirement to explicitly undef is by design to not allow
the function on the left and right side!

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: ingo
Subject: Re: can't redefine identifier
Date: 5 Jan 2002 04:47:06
Message: <Xns918D6DEDB11C0seed7@povray.org>

wrote:

>> Redeclaring functions is not allowed.
> 
> So documentation needs update in this subject.
> 

Will be changed.

Ingo


Post a reply to this message

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