lua-users home
lua-l archive

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


On Saturday, November 27, 2010, Paul Hudson <phudson@pobox.com> wrote:
>>This branch of the discussion was about short forms for returning expressions.
>
> It would be a pity (IMO) if it didn't handle statements too. E.g. foreach is a common higher order function that is just for its side-effects. Of course, the function could always return a value that's ignored.

The foreach case is properly covered by the generic for loop. If you
want side effects from an expresision, you'd have to define a
temporary function and call it, or use the long litteral.

--Pierre-Yves

-- 
-- Pierre-Yves