lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi!

I have a pretty strange question about Lua.
We use tables to emulate classes in the Lua 5.0 language.
Now is there a way to "intercept" method calls this way... so that whenever i invoke
a method on a table a C Function is called ( similar like this )

LUA:
myObject:doSomething()

C++
void OnMethodCall( const char * methodname,lua_State * s )
{

}

This would allow us to automate our export of C++ classes to lua , since we have a very sophistcated C++ reflection system in place, which allows us to determine a C++ classes methods at runtime.
This way we would never have to write wrappers again etc..



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/