<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Nice argument, Jakob! Or asked the other way around:</p>
<p>How would you explain to a new Squeaker that "match:" means a whitespace matching test and "matches:" means a regex matching test? This just feels random to me. :-)</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">#match: is not a nice name at all, IMHO, because it does not make clear that this is a test selector.
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont"></font></div>
</div>
</font></div>
</div>
</div>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><br>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Best,</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Christoph</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Jakob Reschke <forums.jakob@resfarm.de><br>
<b>Gesendet:</b> Montag, 20. April 2020 20:07:18<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Collections-ct.885.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Isn't this more of a problem when you attempt to *write* the code?<br>
(Assuming acceptable variable names.) Then asRegex will not help you<br>
because you have not written it yet. :-)<br>
<br>
Am Mo., 20. Apr. 2020 um 18:19 Uhr schrieb Marcel Taeumel<br>
<marcel.taeumel@hpi.de>:<br>
><br>
> Hmm... I always get confused whether the receiver of #match: is the pattern or the thing that should match the pattern. I suppose that the #asRegex variant makes it explicit and is thus quite readable in this regard.<br>
><br>
> Best,<br>
> Marcel<br>
><br>
> Am 11.04.2020 15:12:01 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:<br>
><br>
> Good question which I cannot answer :-)<br>
><br>
><br>
> The idea is that you could use whitespace patterns ('Squeak *alpha') interchangeably with more powerful regular expressions ('Squeak \d+\.\d+alpha' asRegex) without needing to define separate messages wherever patterns are used. For example, we would need
 implement both #assert:matches: *and* #assert:matchesRegex: (TestCase), both #classesIn: *and* #classesInRegex: (provided that we wanted this feature) etc., each pair with exactly the same implementations that only deviate in terms of sending #match: vs. #matches:.<br>
> (For a practical example, you could take a look at all these methods from SqueakByExample that contain 'match' in their name and which all use #matches:. This project also includes a String >> #matches: extension so it is much easier to feed these morph query
 methods either with regexs or with simple patterns where regexs are unnecessary complicated.)<br>
><br>
> I agree that it might be confusing if you forget the #asRegex. However, I think this is a common problem in a language with duck typing and very-late binding. On the contrary, one could also argue that it might be confusing that in some situations you need
 to send #match:, but in other situations #matches: instead, as they basically do the same.<br>
><br>
> ---<br>
><br>
> Hm, this discussion reminds me a bit of the recent debate about Symbol >> #numArgs/#value:value:. There we found that instead of handling symbols like blocks, we could also write an explicit converter (#asBlock). How would you think about a similar converter
 in this case? :-)<br>
> Something like: 'Squeak *alpha' patternAsRegex<br>
> 'ab*' asRegex matches: 'a'. "true"<br>
> 'ab*' asRegex matches: 'abb'. "true"<br>
> 'ab*' patternAsRegex matches: 'a'. "false"<br>
> 'ab*' patternAsRegex matches: 'abc'. "true"<br>
><br>
> Pro: Actually a matcher - you don't have a string that partially behaves like a matcher and follows the same protocol, but an actual matcher. So you could also say 'ab*' patternAsRegex matchesIn:collect: ...<br>
> Contra: Actually a matcher - this can be a significant drawback in terms of performance. For a simple '*xyz*' match, the regex equivalent was more than 100x slower than the whitespace version.<br>
> A third variant would be an extra WhitespaceMatcher. But do we really need such a class?<br>
><br>
> Best,<br>
> Christoph<br>
> ________________________________<br>
> Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Jakob Reschke <forums.jakob@resfarm.de><br>
> Gesendet: Freitag, 10. April 2020 11:36:37<br>
> An: The general-purpose Squeak developers list<br>
> Betreff: Re: [squeak-dev] The Inbox: Collections-ct.885.mcz<br>
><br>
> The patterns matched by match: are not regular expressions. Could this<br>
> intermixing of vocabulary lead to confusion or even bugs (when someone<br>
> is missing a test for their matching use case and forgot the asRegex)?<br>
><br>
> Am Do., 9. Apr. 2020 um 14:39 Uhr schrieb Thiede, Christoph<br>
> <Christoph.Thiede@student.hpi.uni-potsdam.de>:<br>
> ><br>
> > See also SUnit-ct.127 (#assert:matches:) or Tests-ct.429 (#assertText:) in the Inbox which could benefit from this extension.<br>
> ><br>
> ><br>
> > I would also welcome to completely rename #match: into #matches: for the reasons described below, how would you think about this?<br>
> ><br>
> > Or should String >> #matches: rather be an extension method from the Regex-Core package?<br>
> ><br>
> ><br>
> > Best,<br>
> > Christoph<br>
> > ________________________________<br>
> > Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
> > Gesendet: Donnerstag, 9. April 2020 14:35:36<br>
> > An: squeak-dev@lists.squeakfoundation.org<br>
> > Betreff: [squeak-dev] The Inbox: Collections-ct.885.mcz<br>
> ><br>
> > Christoph Thiede uploaded a new version of Collections to project The Inbox:<br>
> > <a href="http://source.squeak.org/inbox/Collections-ct.885.mcz">http://source.squeak.org/inbox/Collections-ct.885.mcz</a><br>
> ><br>
> > ==================== Summary ====================<br>
> ><br>
> > Name: Collections-ct.885<br>
> > Author: ct<br>
> > Time: 9 April 2020, 2:35:32.800949 pm<br>
> > UUID: ddccd842-af02-a448-91f7-7556c8c7bf43<br>
> > Ancestors: Collections-dtl.884<br>
> ><br>
> > Proposal for discussion: Add String >> #matches: for polymorphy with RxMatcher.<br>
> ><br>
> > This allows you to pass patterns strings whereever a RxMatcher is expected. Furthermore, IMHO the name #matches: gives you a better intuition for a test selector than #match: does.<br>
> ><br>
> > | password patterns |<br>
> > patterns := { '.{8,}' asRegex. '*password*'. '.*\d.*' asRegex }.<br>
> > password := Project uiManager requestPassword: 'Enter a fake password'.<br>
> > self assert: (patterns allSatisfy: [:pattern | pattern matches: password]) description: 'Your password is not safe enough'.<br>
> ><br>
> > =============== Diff against Collections-dtl.884 ===============<br>
> ><br>
> > Item was added:<br>
> > + ----- Method: String>>matches: (in category 'comparing') -----<br>
> > + matches: text<br>
> > +        "For polymorphy with RxMatcher."<br>
> > +<br>
> > +        ^ self match: text!<br>
> ><br>
> ><br>
> ><br>
><br>
><br>
<br>
</div>
</span></font>
</body>
</html>