[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Proposal] Lua-y lambda syntax
- From: "Soni L." <fakedme@...>
- Date: Fri, 28 Apr 2017 18:12:45 -0300
On 2017-04-27 04:00 PM, Russell Haley wrote:
On Thu, Apr 27, 2017 at 11:39 AM, Soni L. <firstname.lastname@example.org> wrote:
On 2017-04-27 03:12 PM, Egor Skriptunoff wrote:
On Thu, Apr 27, 2017 at 8:59 PM, Soni L. <email@example.com
You need to use select() if you want multiple return values.
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
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.
I was just contemplating how one would add a linq like feature to Lua
for searching and returning result sets as tables without having to
write iterators. This syntax would solve that problem quite nicely,
wouldn't it? However, would that mean the need to add other functions
like where(), join() and similar 'SQL like' concepts?
Anyway, a DSL for SQL queries in Lua sounds awesome. I guess this
"lambda syntax" I proposed would do for some impressive DSLs.
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.