[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Switch/Case statements revisited
- From: "Gregg Reynolds" <dev@...>
- Date: Wed, 7 Nov 2007 09:46:58 -0600
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