lua-users home
lua-l archive

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




On 2017-04-27 03:12 PM, Egor Skriptunoff wrote:
On Thu, Apr 27, 2017 at 8:59 PM, Soni L. <fakedme@gmail.com <mailto:fakedme@gmail.com>> wrote:


    You need to use select() if you want multiple return values.


That's awkward.
local function nop(...) = select(1, ...)

local function swap(a,b) = nop(b,a)

It's the best way to add lambdas without introducing wildly different syntax.

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.