Re: Switch/Case statements revisited
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Switch/Case statements revisited
 
- From: "steve donovan" <steve.j.donovan@...>
 
- Date: Fri, 9 Nov 2007 11:41:14 +0200
 
On Nov 9, 2007 11:05 AM, Asko Kauppi <askok@dnainternet.net> wrote:
> How about making a "competition" or a quest for the perfect switch
> (if there is one) right here on the mailing list?
I'm wondering, was there ever a great language feature which came out
of a mailing list discussion? Not sarcastic, just genuinely
interested.
My vote is for David Given's suggestion:
match k
 with 10, 11 then return 1 end
 with 12 then return 2 end
 with i if 13<=i and i<=16 then return 4 end
end
It's understood to involve just linear chains of elseifs ;)
steve d.