[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: lua_ref's... how to?
- From: "Bilyk, Alex" <ABilyk@...>
- Date: Wed, 15 Oct 2003 13:30:53 -0700
From: Ando Sonenblick [mailto:email@example.com]
Sent: Wednesday, October 15, 2003 1:14 PM
To: Lua list
Subject: lua_ref's... how to?
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?