[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How special is "..."?
- From: ketmar <ketmar@...>
- Date: Mon, 10 Nov 2008 11:29:13 +0200
On Mon, 10 Nov 2008 10:17:16 +0100
"Peter Jacobi" <pjacobi.de@googlemail.com> wrote:
> 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
yes. closures doesn't include vararg(...), so you must explicitly
assign vararg to variable. and then variable will be 'closed'.