lua-users home
lua-l archive

Re: Function as metatable (metafunctions?)

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


On Mar 31, 2014, at 2:57 AM, Thiago L. <fakedme@gmail.com> wrote:
> I mean I can't set __metatable to a function so…
Eh?
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 )

AltStyle によって変換されたページ (->オリジナル) /