[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Operators on functions
- From: "Pierre Chapuis" <catwell@...>
- Date: Wed, 20 Nov 2013 14:49:17 +0100
> On Wed, Nov 20, 2013 at 12:04 PM, Pierre Chapuis <firstname.lastname@example.org>
> (An example of Moonscript implementing a lua-l request is the
> treatment of the colon operator, which is '\' in Moonscript (still
> feels like an escape to me, but colon was out for other reasons).
> That is, a\foo(arg) translates to a:foo(arg), but a\foo without args
> is an expression returning a partial application where the self is
> bound - useful for callbacks.)
Idiomatic Moonscript code (if that exists) is probably more
functional and "clever" than Lua. But I am not sure that this
is always a net win.
For instance, take this. Can you guess what this does?
Yes, this is clever. And error-prone:
I would almost always rather have slightly longer, boring but
straightforward Lua code.