[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Delayed evaluation of expressions
- From: steve donovan <steve.j.donovan@...>
- Date: Sat, 2 Jul 2011 19:29:18 +0200
On Fri, Jul 1, 2011 at 7:37 PM, Jerome Vuarand <jerome.vuarand@gmail.com> wrote:
> The problem with a single keyword is that you have no end delimiter,
> and therefore you cannot return multiple values, but maybe that's nice
> enough.
It would be a deliberate restriction.
> ..., 2. a "do end"
> short syntax for "function() end", and 3. the ability to avoid
> parenthesis around "do end"
I like this one, because it's a fairly common pattern, and continues
the Lua tradition of sugar-coated function calls - with strings, table
constructors, and now a special do..end block.
Compiler will have trouble with this code, of course;
local f = iden
do
...
end
steve d.