lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Mon, 07 Nov 2005 18:35:49 +0100
"Ashwin Hirschi" <> 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 ?
Website	<> ou <>
GnuPG	<> ou hkp://
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