[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Features you would like to see
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 21 Aug 2007 11:43:01 -0300
> Assume we somehow recognized do as shorthand for creating a function:
I think that 'do ... end' would be better as a 'value-block', that is,
a block that produces a value. Something like
a = do
local b=f(1,2)
local x=g(3)
=h(b,x) -- need some way to signal the value of the block
end
As Mark pointed out, using 'return' to signal the value of the block may
be confusing.
This extension would also go well with 'if ... then ... else end' value
expressions:
m = if a<b then a else b end
It'd be nice to allow locals inside the then and else blocks; in this case
we would need a way to signal the value of the block.
Not that Lua needs either of these... :-)
--lhf