On 03/05/2017 03:01 AM, Sven Van Caekenberghe wrote:
I also think that allowing concatenation on Symbols does not violate their immutability contract.
As a thought experiment, what could be the problem with adding
Symbol >> , arg ^ (self , arg) asSymbol
?
Aside from the infinite recursion (I suspect you meant super rather than self) :-) , I wouldn't have any problem with that.
(I have found the original issue raised annoying as well)
On 5 Mar 2017, at 11:35, Peter Uhnak<i.uhnak@gmail.com> wrote:
I don't need (or want) to mutate the receiver. Actually I thought that String is also immutable. $, could just return a new symbol instance instead. Concating symbols is quite practical for metaprogramming, as most things are named with symbols and compare by identity...
Somewhat unfortunately, imho, Smalltalk Strings are mutable. I've not seen this feature used often, except by internal operations that could just as well be using a CharacterBuffer or whatever would replace String as the mutable thing if you made String immutable. Regards, -Martin