[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: special forms, take two (was Re: A lua version of "amb")
- From: Mark Hamburg <mark@...>
- Date: Wed, 29 Feb 2012 17:51:21 -0800
On Feb 28, 2012, at 5:08 PM, Sam Roberts wrote:
> Its been pointed out before, that using strings and parsing them and
> returning a function is a way of providing this
> kind of terseness in an environment that requires it:
>
> table.sort(T, lambda[[|x,y|(x> y)]])
> table.sort(T, lambda"|x,y|(x> y)")
> table.sort(T, L"|x,y|(x> y)")
>
> A bit of a pain, but if you have so many uses of these tiny
> expressions you are dying for a lambda, maybe not too much.
The pain is the lack of compile time syntax checking and the ability to capture upvalues (though maybe that latter point is compensated for by also preventing a proliferation of closure constructions).
Mark