<div dir="ltr"><div dir="ltr">Hi Levente and Jakob,</div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Am Mo., 29. Juni 2020 um 01:43 Uhr schrieb <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>>:<br>
>><br>
>> + ----- Method: MCDirectoryRepository>>includesVersionNamed: (in category 'versions') -----<br>
>> + includesVersionNamed: aString<br>
>> +<br>
>> +       | comparable |<br>
>> +       comparable := ((aString endsWith: '.mcz') and: [ aString size > 4 ])<br>
>> +               ifTrue: [ aString allButLast: 4 ]<br>
>> +               ifFalse: [ aString ].<br>
><br>
> Thank you for the suggestion. Why not use aString asMCVersionName<br>
> versionName here?<br>
<br>
Copy-paste from parent.<br>
When Chris introduced MCVersionName, he tried to use #asMCVersionName <br>
there, but later he reverted it according to the history of the parent <br>
method. It probably broke stuff (see below). </blockquote><div><br></div><div>Hmm...  that's true, unfortunately, my comment only says, "Fix" it with no other details.  I can't help but wonder if it was due to a #class test somewhere..</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I think MCVersionName is something that should not exists in its current <br>
form. Why?<br>
- it's a subclass of ByteString, which limits the possible character set<br></blockquote><div><br></div><div>It's common in the IT industry for Name identifiers to be restricted to a subset of ASCII to support interoperation with as many types of systems as possible.  It seems an appropriate choice for MC Version names.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- #= is not commutative when one object is an MCVersionName, the other is <br>
a ByteString:<br>
        'foo' = 'foo.mcz' asMCVersionName. "==> false"<br>
        'foo.mcz' asMCVersionName = 'foo'. "==> true"<br>
- the above property breaks the contract of #hash and #=, so they <br>
sometimes misbehave in hashed collections<br></blockquote><div><br></div><div>Not in actual practice, though.  The intent was that all uses of version names would be ensuring they're dealing with the first-class MCVersionName.  If one, theoretically, were to mix Strings and MCVersionNames as in your example, yes, it would misbehave so... "don't do that."  :)</div><div><br></div><div> - Chris</div></div></div>