[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Function as metatable (metafunctions?)
- From: Javier Guerra Giraldez <javier@...>
- Date: Mon, 31 Mar 2014 12:29:33 -0500
On Mon, Mar 31, 2014 at 12:14 PM, Petite Abeille
<petite.abeille@gmail.com> wrote:
> local aFunction = function() end
> debug.setmetatable( aFunction, { __tostring = function() return 'm e t a f u n c t i o n' end } )
> print( aFunction )
....
local anotherFunction = function() .... end
print (anotherFunction)
so, you can't set metatable to _a_ function, you set the global
function type's metatable
--
Javier