lua-users home
lua-l archive

Re: BASIC-like Lua variant

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


On 2014年01月14日 13:55, steve donovan wrote:
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("")
smt.__add = function(x,y) return x..y end
= "one" + "two"
onetwo
Very interesting.
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.

AltStyle によって変換されたページ (->オリジナル) /