<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 2, 2011, at 14:00 , Willem Broekema wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Wed, Mar 2, 2011 at 9:44 AM, Marco Antoniotti <<a href="mailto:marcoxa@cs.nyu.edu">marcoxa@cs.nyu.edu</a>> wrote:<br><blockquote type="cite">New version with most egregious mistakes corrected.<br></blockquote><br>Thanks for the fixes on the points I raised.<br>I'm feeling like I miss the use case for EQUALS. The document states:<br><br>"... while writing algorithms and libraries it would be useful to have<br>"hooks" in the type and class system allowing for the definition of<br>extensible equality and comparison tests."<br><br>If an algorithm does comparison operations, then the interface should<br>accept a :test argument. Where does EQUALS come into play? I'm<br>interested in an example.</div></blockquote><br></div><div>I guess the answer is: as a default to to <font class="Apple-style-span" face="'Courier New'">:test</font> argument. Apart from that, I find using something like <font class="Apple-style-span" face="'Courier New'">EQUALS</font> allows me to avoid <font class="Apple-style-span" face="'Courier New'">FUNCALL</font> in the code, thus making it more readable.</div><div><br></div><div><font class="Apple-style-span" face="'Courier New'">(defun search-node (k n)</font></div><div><font class="Apple-style-span" face="'Courier New'"> (when n</font></div><div><font class="Apple-style-span" face="'Courier New'"> (if (equals k (node-key n))</font></div><div><font class="Apple-style-span" face="'Courier New'"> n</font></div><div><font class="Apple-style-span" face="'Courier New'"> (case (compare k (node-key))</font></div><div><font class="Apple-style-span" face="'Courier New'"> (< (search-node k (node-left n)))</font></div><div><font class="Apple-style-span" face="'Courier New'"> (> (search-node k (node-right n)))</font></div><div><font class="Apple-style-span" face="'Courier New'"> (/= (error "Cannot discriminate."))</font></div><div><font class="Apple-style-span" face="'Courier New'"> ))))</font></div><div><br></div><div>The example above - which can be shot down in a number of ways - may not convince you, but it is an example of code that you may want to write.</div><div><br></div><div>Having said that, if you want to raise that argument, then, in all fairness, <font class="Apple-style-span" face="'Courier New'">EQUALS</font> is pointless. Yet, IMHO, that is not the point :)</div><div><br></div><div>Cheers</div><div>--<br>Marco Antoniotti<br><br></div><br></body></html>