lua-users home
lua-l archive

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


I'm against do for lamdas, since it is actually the very contrary.
Nothing is done / executed here, but a code is constructed to be done
later.

2010/11/25 Pierre-Yves Gérardy <pygy79@gmail.com>:
> On Thu, Nov 25, 2010 at 13:02, Rob Kendrick <rjek@rjek.com> wrote:
>>        do [ x, y ] return x * y end
>
> Yep, but with an optional short return statement.  It is still much
> more readable than the current syntax. I'd like to have a syntax
> that's clearly different from function invocation.
>
> function acc()
>   local up = 0
>   return do [x] up = up+x; => up end
> end
>
> "return do" is weird, though.
>
> -- Pierre-Yves
>
>