[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: first class ':'
- From: David Kastrup <dak@...>
- Date: Tue, 15 Sep 2009 10:00:38 +0200
froese@gmx.de writes:
>> > So, is there some support for Mark Hamburg's closure sugar in Rio ;) ?
>>
>> Yes. Here we would write C(set, "values") for C:values and define C as
>>
>> C = function (obj, met)
>> met = obj[met]
>> return function (...) return met(obj, ...) end
>> end
>
> A proposal for Lua 5.2:
>
> Make ':' an operator which creates a function with a bound first
> parameter. Like your definition of C above.
> That way, the colon operator is no longer syntactic sugar,
[...]
But I like the things that are just syntactic sugar in Lua: it means
that you can exhaustively explain them in more basic terms in one
sentence.
--
David Kastrup