lua-users home
lua-l archive

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




On Mon, Jul 23, 2018 at 5:43 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
2018-07-23 16:07 GMT+02:00 Scott Morgan <blumf@blueyonder.co.uk>:

You are not entitled to assume that obj1..obj2 is defined as
tostring(obj1)..tostring(obj2). You are not even entitled to
assume that the result of concatenation is string-valued.

For example, concat may mean list concatenation.

obj{1,2,3}..obj{4,5} --> obj{1,2,3,4,5}


I have profitably used this property to delay string concatenation in a string-builder pattern.

Quite nice, actually, since I had started with simple strings and was able to drop this in.