lua-users home
lua-l archive

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

On Nov 9, 2007 11:05 AM, Asko Kauppi <> 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

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

It's understood to involve just linear chains of elseifs ;)

steve d.