[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: First class : (was Re: Regarding the name 'pairs')
- From: Mark Hamburg <mark@...>
- Date: Mon, 14 Sep 2009 22:44:19 -0700
On Sep 14, 2009, at 5:26 AM, steve donovan wrote:
On Mon, Sep 14, 2009 at 2:16 PM, Luiz Henrique de Figueiredo
One important reason for not having "set:values" is that it'd be
for "function (...) return set:values(...) end" and this would imply
the creation of a hidden closure.
Yes, it did feel like an incompatible proposal.
So, is there some support for Mark Hamburg's closure sugar in Rio ;) ?
To be fair, though I'm not sure to whom, I think someone promoted it
before I did. ;-)
But the full details of my proposal included:
1. Binds early.
2. Binds strongly. (Weak closures are a separate implementation
3. Only generates a closure when not used at a call site though this
should be purely an optimization.
The piece of syntax I will take credit for promoting since I don't
think I'd seen it elsewhere before is:
and in this case:
Thereby allowing the method name to be an expression while at the same
time not forcing the repetition of obj in an expansion of the colon
I believe this is actually moderately easy to implement as a patch on
the current Lua implementation. (I'd have to go find my notes on how
to do so.)