[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: simply question about syntatic sugar
- From: Nagaev Boris <bnagaev@...>
- Date: Sun, 7 Jun 2015 13:47:08 +0000
On Sun, Jun 7, 2015 at 1:38 PM, Soni L. <fakedme@gmail.com> wrote:
>
>
> 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)
>
Why not
v\abs!
?
It is the moonscript syntax.
--
Best regards,
Boris Nagaev