lua-users home
lua-l archive

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



In the topmost code, your '...' will point to the arguments of the enclosed function (being nil), not the outer generator function's arguments.

Also, ... values will need some storage frame for them, which the 't' table provides (garbage collection, lifespan handling etc.).

-asko


Peter Jacobi kirjoitti 10.11.2008 kello 11:17:

Dear All,


Is there a deep reason that

function Tuple.new (...)
  return function () return ... end
end

doesn't work and must be simulated using:

function Tuple.new (...)
   t = {...}
   return function () return unpack (t) end
end


Regards,
Peter