<br><br><div class="gmail_quote">On Sun, Jun 20, 2010 at 12:02 PM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2010/6/20 Louis LaBrunda &lt;<a href="mailto:Lou@keystone-software.com">Lou@keystone-software.com</a>&gt;:<br>
&gt; On Sun, 20 Jun 2010 11:07:23 +0200, Joachim Geidel<br>
<div class="im">&gt; &lt;<a href="mailto:joachim.geidel@onlinehome.de">joachim.geidel@onlinehome.de</a>&gt; wrote:<br>
&gt;<br>
</div>&gt;&gt;snip...<br>
&gt;&gt;One could just<br>
&gt;&gt;leave it as it is, because the precondition for answering a &quot;correct&quot;<br>
&gt;&gt;rectangle is that the receiver and the argument intersect. If they don&#39;t, the<br>
&gt;&gt;answer is undefined, which means that whatever is answered is correct in a<br>
&gt;&gt;mathematical sense.<br>
&gt;&gt;snip...<br>
&gt;<br>
&gt; I urge some caution here.  If &quot;whatever is answered is correct in a<br>
&gt; mathematical sense&quot; is true then returning any rectangle like (100@100)<br>
&gt; corner: (150@150) would be correct, clearly that is not the case.  In<br>
&gt; Smalltalk, nil is undefined, nil is probably the &quot;correct&quot; answer.<br>
<br>
Yes, this is tempting.<br>
However from a pragmatic point of view that would mean that:<br>
- either every call must be protected with an intersects: test or (...<br>
intersect ...) ifNil: [...]<br>
- or UndefinedObject must understand Rectangle protocol<br>
Answering an empty rectangle seems more simple with this respect.<br></blockquote><div><br></div><div>Tempting but mad.  It will break lots of code.  Instead, simply use a different selector.  For example, intersection: is used by Collection, Matrix and Timespan, all of which have different semantics, so the argument that overloading Collection&gt;&gt;intersection: and Rectangle&gt;&gt;intersection: doesn&#39;t hold; intersection: is already overloaded.</div>
<div><br></div><div>Recently I&#39;ve noticed that someone changed the semantics Integer&gt;&gt;hex in Squeak from 38 to 4.1 for no good reason.  There were plenty of other selectors that could have been used for the new functionality (i.e. printing without a leading 16r).  This kind of careless breaking of backwards-compatibility is an entirely avoidable really bad thing<span class="Apple-style-span" style="font-family: &#39;Lucida Grande&#39;; font-size: 12px; ">™</span>.</div>
<div><br></div><div>best</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Nicolas<br>
<br>
&gt; -----------------------------------------------------------<br>
&gt; Louis LaBrunda<br>
&gt; Keystone Software Corp.<br>
&gt; SkypeMe callto://PhotonDemon<br>
&gt; mailto:<a href="mailto:Lou@Keystone-Software.com">Lou@Keystone-Software.com</a> <a href="http://www.Keystone-Software.com" target="_blank">http://www.Keystone-Software.com</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</blockquote></div><br>