POV-Ray : Newsgroups : povray.programming : Overloading identifiers : Re: Overloading identifiers Server Time
29 Jul 2024 00:30:23 EDT (-0400)
  Re: Overloading identifiers  
From: Nieminen Mika
Date: 28 Jan 1999 12:19:49
Message: <36b09c35.0@news.povray.org>
Ron Parker <par### [at] my-dejanewscom> wrote:
: #declare A=1;
: #declare A=<1,2,3>;
: #declare B=2;
: #declare B=<4,5,6>;
: #declare C=A+B;

  In this case povray could issue an error message like "Ambiguous operands".
  Then perhaps you can typecast the operands like this:

#declare C=(vector)A+(scalar)B;

  Too complicated?-)

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

  It's more intuitive and it saves typing.
  Even if overloadable identifiers were not good, overloadable macros should
be very handy.

-- 
main(i){char*_="BdsyFBThhHFBThhHFRz]NFTITQF|DJIFHQhhF";while(i=
*_++)for(;i>1;printf("%s",i-70?i&1?"[]":" ":(i=0,"\n")),i/=2);} /*- Warp. -*/


Post a reply to this message

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