POV-Ray : Newsgroups : povray.programming : Overloading identifiers : Re: Overloading identifiers Server Time
29 Jul 2024 00:35:01 EDT (-0400)
  Re: Overloading identifiers  
From: Ron Parker
Date: 28 Jan 1999 09:38:40
Message: <36b07670.0@news.povray.org>
On 28 Jan 1999 08:49:18 -0500, Nieminen Mika <war### [at] cctutfi> wrote:
>  Are there any places where you can put an identifier and where it isn't
>unambiguous which kind of identifier it is?

#declare A=1;
#declare A=<1,2,3>;
#declare B=2;
#declare B=<4,5,6>;
#declare C=A+B;

Should C be 3, <5,7,9>, <3,4,5>, or <5,6,7>?

But in general, why is this more useful than just putting the
type information into the declaration?

#declare cGold=rgb <whatever>
#declare pGold=pigment {color cGold}
#declare fGold=finish {whatever}
#declare tGold=texture {pigment {pGold} finish {fGold}}

You know as well as the computer does what you want to use in any 
given place, so just stick the appropriate character on:

light_source {20, cGold }
sphere {0,1 texture {tGold}}


Post a reply to this message

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