lua-users home
lua-l archive

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



On May 18, 2006, at 15:23, Roberto Ierusalimschy wrote:

(You cannot change the metatable of other types from Lua, only from C.)

What about debug.setmetatable (object, table)?

debug.setmetatable( 1, { __index = math } )

print( ( -1 ):abs() )

> 1

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/