lua-users home
lua-l archive

Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available

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


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

AltStyle によって変換されたページ (->オリジナル) /