Post by Steven D'ApranoPost by r0gI'd be strongly inclined to think the result would be the sequence on
the left with the data from the second sequence appended to it. What's
wrong with a little duck typing here eh?
OK, I hadn't read all the other responses when I posted, some of which
make fair points why this wouldn't be wise. Fair enough.
Post by Steven D'ApranoThat's not the existing behaviour. List concatenation doesn't mutate the
I would expect it to append. That's my prejudice though, as I do that
far more often :/
Post by Steven D'ApranoPost by r0gL = [1, 2, 3]
L2 = L + [4, 5, 6]
L
[1, 2, 3]
[1, 2, 3, 4, 5, 6]
But if you insist on in-place modification, why do you prefer appending
the right hand sequence to the left instead of prepending the left hand
sequence to the right?
In-place seems more natural for a mutable type. I admit the left right
thing is my prejudice though, western cultural bias I suppose. Its not
entirely unprecedented though, the parser reads left to right and the
leftmost terms take precedent in lazy logic evaluation.
Still, the responses to this have convinced me the + operator shouldn't
make assumptions, I'm more open to how += works though as it implies
in-place and the left over right precedent quite nicely.
Roger.