|
|
Since it does have to have semi-colons after floats, vectors, and colors, I
wish it would accept semi-colons after arrays and anything else that might
be declared. It's a nuisance to have to think about whether i should put one
in after I declare something. Perhaps it shouldn't be *required* for things
other than floats, vectors, and colors, but it'd be nice if it were
*accepted*.
- Slime
[ http://www.teja.nu/slime/ ]
[ http://www.teja.nu/slime/images/ ]
"Trevor Quayle" <Tin### [at] hotmailcom> wrote in message
news:3bb0eaba$1@news.povray.org...
> > BTW: I don't like the ; semicolon after #declare. it seems so wrong for
> > me, because it is a #directive that goes to the compiler. on C++, it
> > will Not have ; semicolon.
> >
>
> I used to think the same, but there is a good reason why.
> From the docs:
> Note that there should be a semi-colon after the expression in all float,
> vector and color identifier declarations. This semi-colon is introduced in
> POV-Ray version 3.1. If omitted, it generates a warning and some macros
may
> not work properly.
>
>
>
> try the following as a very simple example of why:
>
> #macro Add3 (a,b,c)
> #declare ab=a+b;
> ab+c
> #end
>
> sphere{0 Add3(1,1,1) pigment{red 1}}
>
> then remove the semi-colon and try again. It doesn't work because POV
> doesn't truncate at the end-of-line so without the semicolon, it does not
> know when tho end the declare in this case and the declare essentially
> becomes:
>
> "#declare ab=a+b ab+c"
>
> ab+c becomes part of the decalre rather than being a separate operation.
>
>
>
> -tgq
>
>
>
>
> --
> camera{location z*13look_at 0}light_source{15 15looks_like{sphere{0 10
> }pigment{rgb 1}finish{ambient 15}}}union{torus{3,0.5rotate x*90}cone{y
> *4,.5,-y*8,0}cone{-x*4,.5,x*8,0}pigment{rgb<.7,.6,.4>}finish{ambient 0
> diffuse 0reflection{1fresnel on metallic 1}}interior{ior 25}rotate 15}
> plane{y,-7pigment{checker rgb 0rgb 1scale 4}finish{diffuse.1}}// TGQ
>
>
>
>
>
>
>
>
>
>
Post a reply to this message
|
|