+ operator should concatenate operands
Brought to you by:
nathanfunk
The + operator should concatenate the operands if
*either* of them is a string, not only both. That way,
"abc " + 10.0 should return "abc 10.0".
A simple implementation using String.valueOf() for both
operands would be good enough. There's an attached
patch that does exactly that.
Logged In: YES
user_id=743015
An alternative is to implement a Str function which would
turn any object into a String. So it would be possible
to do 'Str(1) + Str(2)'.
Logged In: NO
I agree.
Please verify that
"A" + 1 + 2 should be "A12" (not A3B)
"A" + (1 + 2) should be "A3"
1 + "A" + 2 should be "1A2"
1 + 2 + "A" should be "3A"
just like Java.