[squeak-dev] The Inbox: Collections-ct.827.mcz

Chris Muller asqueaker at gmail.com
Tue Jun 4 17:40:37 UTC 2019


> My use case was about concatenating strings in order to build a filter string
> (where order does not matter), but I agree this can be achieved using
> asArray as well.

Sending #asArray would introduce the unnecessary creation of an
interim collection for every single query, even while making the code
unnecessarily wordy and harder to read.

> My desire was to make #asCommaString and #joinByDelimiter: consistent, so
> why not move asCommaStringWithAnd etc. down to OrderedCollection and rename
> it to joinWithComma etc.?

Goran had a mini-family of methods that does this same thing in
Collection since 2005.  Adding all of the above up, it seems very
clear that the 2015 addition of #joinSeparatedBy: must not have
noticed all of the above, so was inserted into a different place while
duplicating the existing implementation.

Your use case disproved the theory that "it doesn't make sense".  It
makes perfect sense.  We should just move it to Collection, and remove
asCommaString and change senders to use this method.

 - Chris


More information about the Squeak-dev mailing list