lua-users home
lua-l archive

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


A sentence got lost somewhere...

>    foo = {}
>    function bar()
>        foo.baz = do[] return "Something" end
>    end
>
>    bar()
>    foo.baz() --> an error should be raised.

"bar" could be compiled as

>    function bar()
>        local _R = true
>
>        foo.baz = do[]
>            if _R
>            then return "Whatever"
>            else error()  end
>        end
>
>        _R = false
>        -- <----------- return goes here.
>    end

-- Pierre-Yves