in reply to Compare/Diff on nested data structures

Actually, what you are really want is diff rather than compare, but it is a non-trivial problem.

I suspect that the reason you are having trouble finding anything is that the way differences are represented are likely to be highly application specific. While a pass/fail (compare) test is fairly unambiguous with a result that is easy to interpret, how are you going to represent the difference between two data structures? As a list of insertions/deletes to be performed on one that will result in the other? As a list of nodes that are present in one, but not the other? As two lists of missing nodes, one for each structure? Something else?


True laziness is hard work
  • Comment on Re: Compare/Diff on nested data structures

Replies are listed 'Best First'.
Re^2: Compare/Diff on nested data structures
by cosmicperl (Chaplain) on Mar 22, 2009 at 02:49 UTC
    Actually, what you are really want is diff rather than compare, but it is a non-trivial problem.
    That was implied in the title :)