lua-users home
lua-l archive

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


On 11/7/07, Fabien <fleutot+lua@gmail.com> wrote:
>
> match k with
...
> | i if 13<=i and i<=16 -> return 4

I like match, but I'm not crazy about that "if"; maybe:

 i AND {13...16}

or the like (substitute your favorite syntax for AND and range
operators...), with the implied set membership operator.  I.e. "match"
really means "predicate", with any logical op, which requires some
curried log ops.  E.g.:

 match k
 ...
 {11...}   // i.e. k \in {11...infinity}  == k > 10

-gregg