lua-users home
lua-l archive

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


Is there a way in Lua to get a reference to the currently-running
function without using the debug library? (I want the equivalent of
"debug.getinfo(1).func") In JavaScript, this property is always
available as "arguments.callee".

The reason I'm asking is I want a way to associate some userdata objects
with a function so that the function always has access to them. In
JavaScript, I'm doing this like:

function foo( ) {
	var theTempVector = arguments.callee.v1;
	// ...
}
foo.v1 = new Vector;