<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hm ... don't we have #<span>splitBy: for this? This seems like a possibly dangerous breaking change to me. No strong opinion, though. :-)</span></p>
<p><span><br>
</span></p>
<p><span>Best,</span></p>
<p><span>Christoph</span></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Chris Muller <asqueaker@gmail.com><br>
<b>Gesendet:</b> Samstag, 19. November 2022 06:24:43<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Collections-cmm.1022.mcz</font>
<div> </div>
</div>
<div>
<div dir="ltr">I don't know why subStrings: should behave differently for empty fields as non-empty.
<div><br>
</div>
<div>Before this change, empty fields are ignored:</div>
<div><br>
</div>
<div> 'a:b::d' subStrings: ':' ==> " #('a' 'b' 'd') "</div>
<div> '::::' subStrings: ':' ==> #()</div>
<div><br>
</div>
<div>after this change, empty fields are honored:</div>
<div><br>
</div>
<div> 'a:b::d' subStrings: ':' ==> " #('a' 'b' '' 'd') "</div>
<div> '::::' subStrings: ':' ==> #('' '' '' '')</div>
<div><br>
</div>
<div>Thoughts?</div>
<div><br>
</div>
<div> - Chris <br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Nov 18, 2022 at 11:14 PM <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Chris Muller uploaded a new version of Collections to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Collections-cmm.1022.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Collections-cmm.1022.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-cmm.1022<br>
Author: cmm<br>
Time: 18 November 2022, 11:14:01.223447 pm<br>
UUID: 9a05d251-4f02-43de-94e8-0f077ec51680<br>
Ancestors: Collections-nice.1021<br>
<br>
Allow empty fields when using #subStrings:.<br>
<br>
=============== Diff against Collections-nice.1021 ===============<br>
<br>
Item was changed:<br>
----- Method: String>>subStrings: (in category 'converting') -----<br>
subStrings: separators <br>
"Answer an array containing the substrings in the receiver separated <br>
by the elements of separators."<br>
| char result sourceStream subString |<br>
- #Collectn.<br>
- "Changed 2000/04/08 For ANSI <readableString> protocol."<br>
(separators isString or:[separators allSatisfy: [:element | element isCharacter]]) ifFalse:<br>
[^ self error: 'separators must be Characters.'].<br>
sourceStream := ReadStream on: self.<br>
result := OrderedCollection new.<br>
subString := String new.<br>
[sourceStream atEnd]<br>
whileFalse: <br>
[char := sourceStream next.<br>
(separators includes: char)<br>
+ ifTrue: [result add: subString copy.<br>
+ subString := String new]<br>
- ifTrue: [subString notEmpty<br>
- ifTrue: <br>
- [result add: subString copy.<br>
- subString := String new]]<br>
ifFalse: [subString := subString , (String with: char)]].<br>
subString notEmpty ifTrue: [result add: subString copy].<br>
^ result asArray!<br>
<br>
<br>
</blockquote>
</div>
</div>
</body>
</html>