[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Identifiers of tables on Stack from C/C++
- From: "Joerg Walter" <joerg-walter@...>
- Date: Mon, 30 May 2011 14:53:39 +0200
Tables are objects in the LUA world. I'm looking for an identifier for the C world. If I wanted to write a table traverser in LUA I would put the table itself as a key into another table to remember that this table has been visited.
I'm looking for the c/c++ equivalent: Putting the table id into an std::set.
1. Using the registry mechanism. But I don't know how this behaves with references on tables.
2. Simply using lua_topointer(): Same question
-------- Original-Nachricht --------
> Datum: Mon, 30 May 2011 09:20:10 -0300
> Von: "Ignacio Burgueño" <email@example.com>
> An: Lua mailing list <firstname.lastname@example.org>
> Betreff: Re: Identifiers of tables on Stack from C/C++
> On Mon, May 30, 2011 at 4:05 AM, Joerg Walter <email@example.com> wrote:
> > Hi
> > I'd like to cylce through a table variable from a C function. Since
> > can contain references on tables and since this can result in cyclic
> > structures I need to know somehow that I'm am stuck in a cycle at some
> > point. I have save remember which table I already have visited. What is
> > appropriate identifier of a table and how can I retrieve it from C?
> Can't you use the table itself as the key?
NEU: FreePhone - kostenlos mobil telefonieren!
Jetzt informieren: http://www.gmx.net/de/go/freephone