[squeak-dev] The Inbox: CollectionsTests-cmm.312.mcz
Chris Muller
ma.chris.m at gmail.com
Wed Jun 5 02:54:33 UTC 2019
Hi Nicolas,
>
> I did mean that the test omitted to check joined length, so an
> implementation returning 'a|b|c|' would pass...
>
The original test didn't test that either, but I went ahead and added it
into CollectionsTests-cmm.315.
> Also, for the bag case, i would expect to find the 5 z in joined, and i
> do not see it in the new version of the test.
>
CollectionsTests-cmm.315 now covers that. All green.
> IMO, the unordered case is going to need a separate method, because it
> already takes too much place relatively to more usual sequenceable case.
>
With this new test, I hope you're convinced otherwise now.
> The difficulty to write these tests, and relative length of
> sequenceable/unordered cases speak by themself: it perfectly illustrate non
> obvioussness of the feature, that's why i asked.
>
They were _not_ difficult to write at all. Nicolas, I wrote and improved
them in near real-time to your suggestions! Now they're more robust than
they were before. Your #sorted comparison was genius.
If there's any confusion left, Marcel's original comment says all there is
to say:
"Returns a string, which is a concatenation of each element's string
representation separated by another string."
"Each element's". That's it. It says _nothing_ about sequence. It also
basically duplicates Goran's original Collection>>#asStringOn:delimiter:,
which has never been questioned. On SequenceableCollection is
questionable, IMO.
> So yes, we can easily implement the feature, but should we? IMO, we ain't
> gonna need it, or so rarely...
>
We absolutely should. I'm going to want it when I get to converting Magma
<--> GraphQL query's at performance.
- Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190604/97982eba/attachment.html>
More information about the Squeak-dev
mailing list
|