|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
It appears that A?B:C doesn't work inside functions - but select() does.
Is this documented somewhere? (I presume this is the reason that both
constructs exist in the first place...?)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Andrew the Orchid <voi### [at] devnull> wrote:
> It appears that A?B:C doesn't work inside functions - but select() does.
> Is this documented somewhere? (I presume this is the reason that both
> constructs exist in the first place...?)
Well, is the ?: operator listed as valid operator in user-defined
functions?
While it might not be very clear from the documentation (it should
perhaps be), the SDL and the user-defined functions are basically two
completely different and independent languages. They somewhat resemble
each other, but the user-defined functions are basically a language
inside the SDL, not SDL itself. They are even interpreted at
completely different levels. For this reason not everything that
works in the SDL works in the user-defined functions.
You can create the body of a user-defined function using SDL, but
that's just kind of user-defined function metaprogramming, that is,
a program (in a different language) which creates a program (in the
other language).
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Thu, 24 Feb 2005 21:33:37 +0000, Andrew the Orchid <voi### [at] devnull> wrote:
> It appears that A?B:C doesn't work inside functions - but select() does.
> Is this documented somewhere? (I presume this is the reason that both
> constructs exist in the first place...?)
http://www.povray.org/documentation/view/3.6.1/506/
A?B:C is part of FULL_EXPRESSION which is part of NUMERIC_EXPRESSION
If you would compare it with:
http://www.povray.org/documentation/view/3.6.1/509/
none of the is part of USER_FUNCTION specs.
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> http://www.povray.org/documentation/view/3.6.1/506/
>
> A?B:C is part of FULL_EXPRESSION which is part of NUMERIC_EXPRESSION
>
> If you would compare it with:
> http://www.povray.org/documentation/view/3.6.1/509/
> none of the is part of USER_FUNCTION specs.
Ouch... man, I shouldn't have asked! :-/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> While it might not be very clear from the documentation (it should
> perhaps be), the SDL and the user-defined functions are basically two
> completely different and independent languages. They somewhat resemble
> each other, but the user-defined functions are basically a language
> inside the SDL, not SDL itself. They are even interpreted at
> completely different levels. For this reason not everything that
> works in the SDL works in the user-defined functions.
> You can create the body of a user-defined function using SDL, but
> that's just kind of user-defined function metaprogramming, that is,
> a program (in a different language) which creates a program (in the
> other language).
Yeah - directives execute at parse time, functions execute at runtime.
I think in this case it's more a question of it not being immediately
obviouse that one construct belongs to one set, and the other belongs to
another... (I only checked the function reference)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Andrew the Orchid <voi### [at] devnull> wrote:
> Yeah - directives execute at parse time, functions execute at runtime.
Functions can be used at parse time as well, but it's a completely
different engine which runs them (the SDL parser just calls this
function VM).
--
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |