[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: (kick,ass): => kick( ass ) ::
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 8 Feb 2010 10:58:28 +0200
On Mon, Feb 8, 2010 at 5:40 AM, Doug Rogers <email@example.com> wrote:
> The '|args|expression' form is good for 'function(args) return expression
> end', though I think it would fit better with some sort of closing token.
I like lhf's lambda-style proposal, e.g. \x,y(x+y) - has two
advantages (a) it is absolutely explicit about what the expression
scope is (and can also support multiple return values) and (b) it is
easily implemented by token filters (e.g. using LuaMacro)
Yes, I do like |x,y| x+y but handling the end-of-expression is ...
awkward (and probably for that reason, a problem for people as well)
One could allow ',',')' and ';' to be mandatory closing tokens here
and then it's implementable using token filters. (But then it can bite
your ass when you leave off the closing token!)
We like to keep Lua sugar-free as much as possible, so first prize
would be some acceptable form of token filter. I've had some ideas,
but I'm not sure if there's enough call for pushing this much further.
A first pass would be to patch the token filter patch so that it did
not rely on the presence of a global 'FILTER' (that is, there was an
API which would explicitly register callbacks.)
> form that accepts statements would be nice, too, but I think it would be too
> far from Lua's essence,
Yes, that kind of function needs to be more visible.
- (kick,ass): => kick( ass ) ::, Pierre-Yves Gérardy
- Re: (kick,ass): => kick( ass ) ::, Mark Hamburg
- Re: (kick,ass): => kick( ass ) ::, Majic
- Re: (kick,ass): => kick( ass ) ::, joao lobato
- Re: (kick,ass): => kick( ass ) ::, Norman Ramsey
- Re: (kick,ass): => kick( ass ) ::, Doug Rogers