[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: a = do 7 end
- From: "Michel Machado" <michel@...>
- Date: Fri, 30 Jan 2004 11:48:01 -0200
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