Re: Most awesome string metatable hack
[
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: 2014年1月31日 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