lua-users home
lua-l archive

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


Dear Lua users,

I was just wondering whether it is possible for a C extension function to to determine the name it was called by Lua.
My idea would be to register a single C extension function multiple times to a Lua state, but behave (slightly) differently depending on the name it is called.
For example, this would allow to unify all glue code between a C++ class and a Lua state within a single static method and facilitate a sharing of common code parts (e.g., converting the first argument to the pointer to the object instance).


Any ideas would be appreciated.
Thanks,
Gerald