lua-users home
lua-l archive

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




On 07/06/15 05:57 AM, steve donovan wrote:
On Sun, Jun 7, 2015 at 4:09 AM, Rena <hyperhacker@gmail.com> wrote:
unusual. What I've seen in some dialects is that it automatically
creates a closure; i.e. `f = v:abs` means the same as `f =
function(...) return v:abs(...) end`.
That's how I would read it, and how it works in Moonscript.

The fact that people have very different meanings attached to the
ambiguous syntax v:abs means that it is a bad idea.

Here's better syntactic sugar:

v->abs = v:abs()

(in C, -> is like . but with a dereference, "dereference" being the key here)

--
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.