Hi, there.
I think that, in this case, " someCollection asArray joinSeparatedBy: '-' " would produce more readable code. Even better, sort the collection explicitely: " someCollection sorted: [:a :b | ...]) joinSeparatedBy: '-' ".
-1 (for moving #joinSeparatedBy: into Collection)
Also, I think we should deprecate #asStringByDelimiter: and friends. Looking at the sends, there is not much to do in Trunk.
Best, Marcel Am 03.06.2019 07:32:15 schrieb Nicolas Cellier nicolas.cellier.aka.nice@gmail.com: I agree with Tobias and Subbu, random order makes the feature questionable. Please try to write a TestCase to illustrate the expectations in case of non sequenceable collections.
Le dim. 2 juin 2019 à 07:58, K K Subbu <kksubbu.ml@gmail.com [mailto:kksubbu.ml@gmail.com]> a écrit :
On 02/06/19 12:25 AM, Chris Muller wrote:
The method only uses #do:, which is required of all Collections, so it's not any less clear than #do: on those objects.
Chris,
#do: does yield a sequence but the order is not guaranteed to be same from one send to another.
The provided test case for #joinSeparatedBy: assumed a particular sequence. When Christoph proposed to relax it for all Collections, the existing test cases will also have to change to avoid false fails.
Regards .. Subbu