[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How do you return multiple values?
- From: Mark Hamburg <mark@...>
- Date: Wed, 4 Nov 2009 19:21:46 -0800
On Nov 4, 2009, at 12:35 PM, Patrick Donnelly wrote:
local t = pack(pcall(a));
if not r then error("something") end
return unpack(r, 2, r.n)
(this is what Roberto's code meant to be I think)
Note there is no closure cost here.
But there is the cost of the pack which may actually be higher
depending on how many results you are dealing with v how many upvalues.