How about Smalltalk-2000?

Stefan Matthias Aust sma at 3plus4.de
Wed Feb 16 23:38:05 UTC 2000


>> Which reminds me, how and when did the numeric protocol get into
>> String?  I did '123' + '456' and got '579'.  Is that a good Idea?
>
>I'm not sure whether it is better than no definition at all, but I do
>think this definition is better than concatenation. Long ago Guido
>said in comp.lang.python that he wished he hadn't defined '123' +
>'456' to be '123456', because concatenation was enough different from
>addition to cause troubles in Numeric Python. Squeak's present
>definition for addition of strings is at least commutative. :-)

To concatenate string, actually any object to a string, I'd prefer #& as in

'the result is ' & (3 + 4)

(I know it's trivial to implement but still one has to be careful when to
introduce new binary oprations as they're more difficult to learn than
unary or keyword selectors because they produce more cryptic code.


bye
--
Stefan Matthias Aust  //  Bevor wir fallen, fallen wir lieber auf.





More information about the Squeak-dev mailing list