Hacker News new | ask | show | jobs
by groovy2shoes 247 days ago
Lua has lambdas. They too suffer from verbosity, of course, but they're there.

    function(x) return x; end
2 comments

There are patches for this so the above can be expressed with something like this:

  [ (x) | x ]
http://lua-users.org/files/wiki_insecure/power_patches/5.4/l...

And for Lua 5.1:

http://lua-users.org/files/wiki_insecure/power_patches/5.1/l...

(I personally don’t use patches like this because “Lua 5.1” is something pretty standardized with a bunch of different implementations; e.g. I wrote my Lua book with a C# developer who was using the moonsharp Lua implementation)

That's what I meant and didn't communicate well. I'm wishing for short-form syntax of lambdas, to be clear.