[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How do I add a "local" using the c api
- From: Mark Hamburg <mark@...>
- Date: Tue, 31 Mar 2009 08:06:51 -0700
On Mar 31, 2009, at 6:45 AM, Tom Miles wrote:
Thanks for the quick response, but I think you're misunderstanding
my intentions. What I want to do is add a "local" variable in C,
for a lua script to access.
Which script? A local more or less by definition is only accessible to
a single script so it doesn't make sense to talk about adding a local
to be accessed by an independent script. I'm going to assume that
there is simply a misunderstanding here between your intention and the
question coming through to the list due to some missing key detail.
For example, if your question is really: I've got some C functions and
they need to share a Lua-valued variable but I don't want this
variable visible elsewhere -- i.e., it's local to the C functions --
how do I do this? Then the answer is: A shared environment table for
the functions. (And someone more intimately familiar with the standard
library sources than I am at the moment could point you to an example.)
Mark