lua-users home
lua-l archive

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




On 2017-04-29 05:49 AM, Dirk Laurie wrote:
Like most threads, this one has wandered way off topic. I apologize
insincerely for the fact that this will look on a threaded reader like
a reply to Steve's most recent post.

I have never grasped why people want lambda syntax. The following
is the existing Lua syntax:

fct = λ (a,b,c) → 10*(10*a+b)+c ▪
print(fct(2,7,3))  --> 273
I actually have just made a simple hack of the Lua interpreter that
did the above.

I.e. there is nothing verbose about the syntax, people are just too
lazy to type 'function', 'return' and 'end'.


function a_query(_) =_.SELECT("*").FROM("users").WHERE("age < 100")
for x in do_query(a_query) do
  ...
end

No ugly `end`, looks a lot more like SQL. It's a new option for 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.