Re: BASIC-like Lua variant
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: BASIC-like Lua variant
- From: colinz@...
- Date: 2014年1月14日 14:09:27 +0100
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.