[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Calling Lua function from C
- From: Peter Shook <pshook@...>
- Date: Fri, 20 Jun 2003 10:44:41 -0400
Max Ischenko wrote:
But then another issue arises -- for each function returned
I have to have a duplicate entry in the Registry. While I'm going to
have hundreds of such refs this could become a problem. May be I just
could setup some hash table in Lua with integer indicies and return it
instead of function...
I'm not sure I follow. You have a lot of functions in Lua, that you
want to call from C later on, but you don't need to give them names?
function() return 4+5 end;
function() print(whatever) end;
So you want to call foobar from C, store the table of functions
somewhere, then later on, call each of the functions in a loop or
something? Basically the following in C ?
t = foobar()
for n,v in t do print( v() ) end
- Peter Shook