Re: next == pairs({})?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: next == pairs({})?
- From: Matthew Paul Del Buono <delbu9c1@...>
- Date: 2009年9月24日 16:53:13 -0400 (EDT)
>In my lua interpreter, the first value returned by pairs({})
is not the
>same function as is assigned to next.
Not quite true.
>From memory, this is caused by duplicate Lua functions. First,
next() is created which is a pushed C function. When you call
pairs(), pairs() does not actually query the value of 'next' -
- instead, it pushes the C function lua_next, which causes a
new Lua function to be created. In essence, we have two
distinct Lua values which point to the same C function.
-- Matthew P. Del Buono
EcoEagles, Embry-Riddle Aeronautical University