|
![](/i/fill.gif) |
Warp wrote:
> gimi <gim### [at] psico ch> wrote:
>>One more thing: Neither does it support conditional
>>structures like "#if ... #else ... #end" nor "(C ? A : B)",
>>AFAICS in the docs.
[And gimi also wrote:]
>> So, One would have to workaround this using "select";
>> now I understand why Christopher mentioned that..!
>
> It does. It's called 'select'. 'select' is not a workaround, it's a
> conditional structure.
Of course 'select' isn't a workaround in itself, but its
use as a conditional *structure*. In a practical sense,
it is of course the same, but I would be careful not to
speak of a "structure" if it's in fact a function or
operator. After all, there must be a reason why there
*are* conditional structures, and not just functions,
in programming languages!?
It is listed as a float function in the docs, and I
prefer to put it in the same drawer together with the
signum function, or even the '<=>' operator (Perl).
Or would you call "if ... then ... else" a function?
However, as far as POV-Ray is concerned, I don't know
how these different statements are implemented, nor if
it means anything whether it's called a function or
not...
> In theory adding the support for recursive function calling should
> be easy (AFAIK you could simply remove the existing check which stops
> the parsing if recursion is detected). The problem is that there seems
> to be cases where it doesn't work ok, and fixing it to work always may
> need severe work. For simple recursive functions it should work ok (at
> least according to prototype tests).
I can't help getting the feeling that this POV-language
design or implementation is a little messy...
> (I don't know if it would be a good idea to enable recursion in a patched
> version of povray because of the detected instability, but a personal
> version would be interesting to try.)
It certainly would! OTOH, I think that this would better
be accompanied with some major redesign... - SCNR ;)
Have a nice weekend, I'm off...
gimi
--
"What right does Congress have to go around making laws
just because they deem it necessary?" -- Marion Barry
++++++++++++++++ http://www.psico.ch/ ++++++++++++++++
Post a reply to this message
|
![](/i/fill.gif) |