lua-users home
lua-l archive

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



Having a lua script line like:
Varname = functionname()

And functionname() is a registered c function, how can i read out the
varname from the c funtion.

I'm not quite sure about the example you give... But, functions do not have names. Like strings and numbers they can be assigned to any number of variables, though. For example, take this scenario:

	function q(x) return x * x end
	f = q
	g = q

What would be the "name" of the function that was defined? The f, g and q variables all contain references to it... And these variables may change over time as well.

Perhaps the thing to ask is: why would you want the 'name' of a particular function?

Ashwin.
--
no signature is a signature