|
|
> If we join them then for every call it should be reevaluated. Imagine such
> example:
>
> pigment{
> function{
> if(y>0)
> pattern{object{
> if(z>0)
> sphere{0 1
> else
> box{-1 1
> end
> rotate x* if ( vlength(<x,y,z> > 1 ) 30 else (2+x+y+z) end
> }}}
> else
> x+y+z
> end
> }
> }
Thanks a lot -- you have given me a perfect illustration why (in a good
language) there must be no such thing as pre-processor. Let's rip short
piece out of it and have a closer look:
object{
if(z>0)
sphere{0 1
else
box{-1 1
end
rotate x* if ( vlength(<x,y,z> > 1 ) 30 else (2+x+y+z) end
}
This code fragment is only possible since it is fed to pre-processor, not to
SDL interpreter... Otherwise, you would *have* to write something like this:
#local Rotate = transform { rotate ... }
object { ... Rotate }
(for obvious reasons), that is both more reliable, and... more elegant. A
language with that powerful pre-processor is at risk to quickly become a
"write-only" language, you know... (Perl had succeeded at that w/o
preprocessor at all, but nevertheless... :-)
Post a reply to this message
|
|