lua-users home
lua-l archive

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


Since we're talking 'bout cool metatricks, here's a fun, but mostly useless one:

setmetatable(_G, {__index = function(_, v) return v end})
debug.getmetatable('').__sub = function(s1, s2) return s1..' '..s2 end
print(hello - world)

-- 
NI!

() - www.asciiribbon.org
/\ - ascii ribbon campaign against html e-mail and proprietary attachments