我想知道是否有办法在运行时获取对象的类名。我的意思是这样的:这是我非常简单的脚本
person=TPerson:new()
Run Code Online (Sandbox Code Playgroud)
我想在我的应用程序(在delphi中)中获取“TPerson”,我用lua调试信息尝试了它,但我知道要获取的是函数“new”,但我需要获取类“TPerson”
lua_getstack(l,0,PL_Debug);
lua_getfield(l,LUA_GLOBALSINDEX,'f');
lua_getinfo(l,'n',PL_Debug);
nameOfCurrnetFunction:=PL_Debug.name; // here is stored "new"
Run Code Online (Sandbox Code Playgroud)
那么可以获得类名吗?谢谢