lua-users home
lua-l archive

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

On 15/08/2015 02:05, Sean Conner wrote:

   Here's a better (smaller, faster) function that does the same thing:

	-- --------------------------------------------------
	-- License: GPL, LGPL, MIT, BSD.  Pick your poison.
	-- --------------------------------------------------

	function switch(key,case,otherwise)
	  return (key[case] or otherwise or function() return nil end)(case,key)



BTW, I'd love to see the text of the "Pick your poison" license.

(I couldn't resist!)


-- Lorenzo