[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How catch new globals?
- From: "J. Perkins" <starkos@...>
- Date: Mon, 31 Oct 2005 11:27:25 -0500
On 10/28/05, Tomas <firstname.lastname@example.org> wrote:
> > lua_pushstring(L, "newindex");
> Have you tried "__newindex"?
Yes. As I mentioned in my original post, I tried "newindex",
"__newindex", as well as "index" and "__index". My function is never
So I don't lose the context, here is the important bits of my original
post are below. Maybe this isn't as easy as I thought it would be.
My 4.0 code looked like this:
lua_settagmethod(L, LUA_TNIL, "getglobal");
For 5.0 I tried to do this:
But my function never gets called. I also tried "index", "__newindex",
and "__index", but no avail.
FYI, what I am trying to do is catch statements of the form:
package.name = "MyPackage"
...where `package` hasn't been defined yet. My function will create a
table, populate a few values, and then setglobal("package") before