lua-users home
lua-l archive

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


Perhaps you already found your solution, but since I was looking for the same information I figured I would respond.  Passing in "f" to the lua_getinfo function will push the function onto the top of the Lua stack.

Max

On 10/18/07, Dmitriy Iassenev <[email protected]> wrote:

> > is it possible to find out what environment is associated with

> > function at the specified call stack level? 

> Yes, with the function getfenv http://www.lua.org/manual/5.1/manual.html#pdf-getfenv


:-) but how is it possible to obtain a function object in the Lua

stack, in case when we have properly filled instance of the lua_Debug

structure only?


I found that there is i_ci variable in the private part of this

structure, but have no clue how to get a calling function from it.

Is it the right way to get the calling function?



Yours respectfully,


Dmitriy Iassenev, [email protected]

 Phone (mobile): +380958392212

  ICQ: 72752187

   GSC Game World - Ukraine, Kyiv

    http://www.stalker-game.com http://www.gsc-game.com




--
Technical Director
Unknown Worlds Entertainment
http://www.unknownworlds.com