[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Missing function in lua API: move an element on the top of the stack ?
- From: Mildred <mildred593@...>(by way of Mildred <ml.mildred593@...>)
- Date: Mon, 7 Nov 2005 21:36:57 +0100
On Mon, 07 Nov 2005 18:35:49 +0100
"Ashwin Hirschi" <deery@operamail.com> wrote:
>
> > I found in the lua manual a function: lua_insert which put the
> > element on the top of the stack at a given index.
> > But is there a solution to put an element at a given index on the
> > top of the stack (and not a copy of the element like lua_pushfield
> > do) ?
>
> I don't know about lua_pushfield, but how about using lua_pushvalue
> and lua_remove?
>
> Ashwin.
Just a mistake. Replace lua_pushfield by lua_pushvalue ...
The problem of that function is that a copy is made. And I want the
same object
For example, If I have a table obj and a subtable obj.child. I want
obj.child.parent to be obj itseld.
Then If I modify obj.child.parend, obj is also modified (because it is
the same object)
Am I clear ?
Mildred
--
Mildred
Website <http://louve.dyndns.org> ou <http://mildred632.free.fr>
GnuPG <http://mildred632.free.fr/gpg_key> ou hkp://pgp.mit.edu
Fingerprint : 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 <9A7D_2E2B> (ID)
Ce courrier E-mail doit être considéré comme une correspondance privée.
Attachment:
signature.asc
Description: PGP signature