[squeak-dev] [Squeak 4.1] Collections: Failure of Concatenation Operator

David T. Lewis lewis at mail.msen.com
Tue Oct 26 00:11:47 UTC 2010


On Mon, Oct 25, 2010 at 02:51:48PM -0700, Peter Kenny wrote:
> 
> Hello All
> 
> I'm not sure if this is the right place to raise this, but at least this is
> an active group, so perhaps someone will give me a steer if it is not. I
> have mentioned it in Mantis, but the message numbers there make it seem that
> I am the only person posting there and nobody seems to be reading.
> 
> Squeak 4.1 has a method String>>, which does not exist in earlier Squeaks.
> >From the method comment, it is there to allow a concatenation of a String
> with something which is not a collection; the example quoted in the comment
> is:
>        Transcript cr; show: 'The value is: ', 3.
> which is illegal in earlier Squeaks, in Pharo, in Dolphin and in Smalltalk/X
> (I haven't checked others). The problem is that allowing it causes a failure
> in concatenating a string to an array of characters; in my case the
> construct was ('/', Character separators), which was used to generate a
> collection of terminators for String>>findTokens:. As a result, an
> established Squeak package (Todd Blanchard's HTML and CSS Validating Parser)
> does not work 'as is' on Squeak 4.1.
> 
> I have discussed this in Mantis, and proposed two solutions: either get rid
> of String>>, (because what it allows should be illegal) or modify it so that
> the case where the argument is a kind of SequenceableCollection is dealt
> with as in earlier Squeaks.
> 
> I have checked the latest Squeak 4.2 alpha that I can find, and the problem
> is still there. I have gone through the list of posts in this group which
> mention collections, and I cannot find a modification affecting this. If it
> has been dealt with, my apologies. If not, it seems a good idea to look at
> it before Squeak 4.2 is released.
> 
> My Mantis posts can be found at
> http://bugs.squeak.org/view.php?id=7564
>

It's definitely the right place to discuss things like this, and I see
that Andreas has added a comment to the bug report. You have a good point
about breaking an existing package, but in this case IMHO it is something
that would best be addressed in the external package. Even though earlier
versions of Squeak behaved differently, it seems most reasonable to expect
that if you have a string and append something to it, then the result should
be something resembling a string. So the new >>, operator makes good sense
even if it does cause problems for an existing package.

I'm not sure if Todd is activitely maintaining this package, but a
note to him might be in order.

Dave
 



More information about the Squeak-dev mailing list