lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

on 1/30/08 10:48 AM, Fabien at wrote:

> Incidentally, by writing this example, I'm thinking that maybe the
> catch-blocks and the finally-block should share the same scope as the
> try-block (i.e. if local h was declared after the "try" above, it would still
> be accessible to the "finally" code. Just as the "until" condition in plain
> Lua's "repeat...until" is in the loop body's scope). I'm interested by
> potential users advices, before maybe putting that in metalua 0.4.

Horrendous flow control problems in that case:

        error( "Throw" )
        local x = 3
    catch err do
        print( x )

At the point where we threw the error, x did not exist.