lua-users home
lua-l archive

Re: Another example for syntactically lightweight closures

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 2/9/08, Jean-Claude Wippler <jcw@equi4.com> wrote:
> My only suggestion with this would to consider allowing the |... to
> optionally *follow* the call, i.e.
> t:sort() |a,b|( a > b )
Boo (a statically-compiled, inferred-type, Python-like language) does this:
sort(t) do(a:int,b:int):
 return a > b
The convention is that if the last arg is a function it can be
specified in this way.
steve d.

AltStyle によって変換されたページ (->オリジナル) /