[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Most awesome string metatable hack
- From: Elias Barrionovo <elias.tandel@...>
- Date: Fri, 31 Jan 2014 15:30:40 -0200
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