Re: How special is "..."?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: How special is "..."?
- From: ketmar <ketmar@...>
- Date: 2008年11月10日 11:29:13 +0200
On 2008年11月10日 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'.