[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: lua_ref's... how to?
- From: Ando Sonenblick <ando@...>
- Date: Wed, 15 Oct 2003 13:14:20 -0700
Can someone give me a quick overview (or direct me to a page) that
describes what lua_refs can do? I've been looking for details on them,
but most web pages mention them without giving a "here's what and how"
They're also not in the 5.0 manual (that I was able to find).
FYI, what I'm hoping they'll be useful for is something like this: I'd
like to store an arbitrary lua type (be it a variable, a table, a
function, etc) in my C code for later use.
So Ideally, I could
myCPPObject->luaRef = lua_ref(L, true) -- take whats on the top
of the stack and make a ref
then, later in my C code, I can then use that:
lua_getref(myCPPObject->luaRef); -- push the contents of
<call a lua routine>
and then when done, no longer reference it:
Is this how lua ref's work?