lua-users home
lua-l archive

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


Hi,

    Is there some reason for a Lua block not to return a value (the last
expression)?

    If this occurs, the if statement could be a expression and its behaviour
would be similar to that of the logical operators:

    x = x or v

    or

    x = if x then x else v end

    I know that a expression can't be a statement, therefore my subject
doesn't compile. To solve this problem without dirty Lua, like the return
behaviour, the block's last statement could be a expression too.

    This too doesn't break legacy code.

    Attention, this is not a desire, just a curiosity!

[ ]'s
Michel Machado