<br><br><div class="gmail_quote">On Mon, Aug 24, 2009 at 7:35 PM, Jecel Assumpcao Jr <span dir="ltr">&lt;<a href="mailto:jecel@merlintec.com">jecel@merlintec.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">K. K. Subramaniam wrote:<br>
&gt; I meant a difference operator, not the diff(1) program. Change set browser is a<br>
&gt; good tool but is incomplete. It does not track and log all changes (e.g. class<br>
&gt; variables).<br>
<br>
</div>I meant the same thing, but mentioned the text diff program as an<br>
example of what some people would like to be able to use. Back when<br>
Smalltalk-80 used an object table it wouldn&#39;t have been that hard to<br>
create a difference operator for binary images since objects never<br>
changed their &quot;oop&quot;. </blockquote><div><br></div><div>That only works for things that are created in exactly the same order with no intervening operations.  If I were to compile the source for method A followed by compiling the source for method B I would end up with different oops for methods A and B than if I were to first compile method B&#39;s source followed by method A&#39;s source.  Things would also be different if in between compiling I performed some other arbitrary action that caused allocations whose results were discarded.</div>
<div><br></div><div>The problem is orthogonal to direct pointers.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">With direct pointers it is far more complicated to<br>

decide that two objects in separate images are actually the same. The<br>
best strategy is probably to start out with classes and processes and do<br>
a breadth first search.</blockquote><div><br></div><div>What is needed is generic structural comparison.  One problem in this is that certain collections are unordered and therefore comparing structure reachable from unordered collections may involve a combinatoric explosion (compare all possible pair-wise combinations, succeeding if a match is found).  Another problem is what I&#39;ll call incidental concrete difference.  Are these two equivalent or not for the purposes of comparison or not?  (1 to: 3) #(1 2 3)?  (etc)</div>
<div><br></div><div>The schema for code representation in the system is well-defined and several ordering operations exist to allow comparison; selector-method-pairs in method dictionaries can be ordered by lexicographic order of selectors and sibling subclasses can be ordered by lexicographic order of class names.  Hence structural comparison of Smalltalk code is straight-forward.  Generalising to arbitrary object structures isn&#39;t at all straight-forward unless analogous schema are introduced.</div>
<div><br></div><div>Writing a recursive structural equality tester in Smalltalk is straight-forward (I have code written for the Newspeak project I could post if you&#39;re interested) but it fails for unordered collections and for incidental concrete difference.</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<font color="#888888"><br>
-- Jecel<br>
<br>
<br>
</font></blockquote></div><br>