lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] 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

David Kastrup