|
|
In article <3faff7a7@news.povray.org> , Warp <war### [at] tagpovrayorg> wrote:
>> It should not crash of course but your code isn't valid syntax, it can't
>> work.
>
> I have to admit that I'm not sure why it's not valid syntax... (Perhaps
> you should have specified why? :) )
A local function is returned by value. However, you cannot return a
function by value, you can only return a function result by value. So after
the parser notices that this is a function assignment, it attempts to assign
it, but does of course fail because by the time it can notice, the macro has
already been left and the function no longer exists. The reason is that
functions are not copied like other identifiers, but referenced (even if it
would be copied, the problem would remain to decide whether to copy or
evaluate). However, the parser cannot decide what to do prior to leaving
the macro either. Hence, this syntax cannot legal.
That said, I have no good idea how to tell the parser to detect such a case
yet (without some brain-dead ugly hack, of course). Most likely this
problem will persist until POV-Ray 4.0.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|