<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-11-07 14:48 GMT+01:00 Denis Kudriashov <span dir="ltr"><<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="gmail-">2017-11-07 14:45 GMT+01:00 Denis Kudriashov <span dir="ltr"><<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>></span>:<br></span><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span>2017-11-07 14:40 GMT+01:00 Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmai<wbr>l.com</a>></span>:<br></span><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>2017-11-07 14:20 GMT+01:00 Denis Kudriashov <span dir="ltr"><<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I have new question. Why we really need threeWayCompareTo:?</div><div>DefaultSortFunction can implement it using standard comparison methods.</div></div><div class="gmail-m_764451115022994787m_-1024083020267668502m_7563793518736931239gmail-HOEnZb"><div class="gmail-m_764451115022994787m_-1024083020267668502m_7563793518736931239gmail-h5"><div class="gmail_extra"><br></div></div></div></blockquote><div><br></div></span><div>But what would the DefaultSortFunction use?</div><div>2 among the 3 selectors < = > ?</div><div>It's just that we might scan String twice when <=> would do it once, but apart that is OK<br></div></div></div></div></blockquote><div><br></div></span><div>Yes, you are right.</div><div>And we already have VM based String compare: with strange logic returning 1, 2, 3. So we already can optimize current String>>threeWayCompareTo:.</div></div></div></div></blockquote><div><br></div></span><div>Maybe good idea to open ticket and modify image level methods to return standard -1,0,1 values.</div><div><div class="gmail-h5"><div> </div></div></div></div></div></div></blockquote><div><br></div><div>We should have done that for long.</div><div>But we want to avoid images to behave differentlly depending on VM version.</div><div><br></div><div>Possibility 1:</div><div></div><div>add a new primitive, marking the old as for backward compatibility, and modify image side</div><div>with backward compatibility support (try new prim, if failure try old, if failure revert to Smalltalk code)</div><div><br></div><div><div>Since this primitive is only for accelerating things and not strictly necessary, we don't need backward compatibility so:</div><div><br></div></div><div>Possibility 2:</div><div>add a new primitive, and modify image side (try new prim if failure then revert to Smalltalk code)<br></div><br></div><br></div></div>