[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Sun, 21 Nov 2010 22:27:09 +0100
my 2 cent:
function(x,y,z)
dostuff(x,y,z);
return x+y, x+z
end
should be translated to:
@(x,y,z)
dostuff(x,y,z);
@[x+y, x+z]
Pretty compact written on one line, but still readable:
@(x,y,z) dostuff(x,y,z); @[x+y, x+z]
Only 1 new symbol (@) and two new tokens @( and @[
@( will mark the beginning of a parameter list;
@[ the beginning of a multiple return
cheers
--
Lorenzo