[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Detect C or Lua function?
- From: "J. Perkins" <jason@<a href="/cgi-bin/echo.cgi?379.com">...</a>>
- Date: Thu, 14 Feb 2002 12:03:26 -0500
Why do you want to do this, anyway?
I have a C++ component system which I've tied into Lua. A component
may have a "scriptable" implementation, which just dispatches all of
it's calls off to Lua. In Lua, the component is represented as a
table with it's "index" tag set to it's "base class", which contains
C functions and maybe some Lua functions. The user can add script
functions to the table to override the C functions. If I have a C++
function call 'doSomething()', the scriptable implementation will
try load the component's table and try to call it's "doSomething"
function. If there is no Lua implementation of that function, the
inheritance will return the C function, and if I call that I end up
in an endless recursion.
Thanks for your help. That's my third question now where I should
have just RTFM. I won't do it again.