|
On 2014-01-14 13:55, steve donovan wrote:Very interesting.
Lua is flexible in that way. Operations on strings are 'metamethods'
and they can be overrided:
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
smt = debug.getmetatable("")onetwo
smt.__add = function(x,y) return x..y end
= "one" + "two"
However, since I would not be able to make these modifications by myself (being a newbie) I have to ask: is there any library/module that has already implemented such customizations? I am sure I am not the only one who would rather have + for concatenation instead of ..
Of course, my question is general, not limited to concatenation.