lua-users home
lua-l archive

[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