[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: can a C extension function determine its name?
- From: "Gerald Franz" <gerald.franz@...>
- Date: Mon, 1 Oct 2007 00:15:54 +0200
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.