--X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jul 19, 2003 at 12:20:39PM +0900, John W. Long wrote: > The problem: I solved it, being more or less focused on size (but not really a lot) and when I was about to 'optimize' it I read that size doesn't matter :-) Well, you can find attached my first take. Note that I changed a couple things in the test cases when I either couldn't figure out the semantics or thought there was something wrong. > string1, string2 bjectDiff.compare(object1, object2) > puts [string1, string2] > assert_equal('#<TestObject1:0x1 ... @b", ... @d ", ...>', string1) ", ...>', string1) > assert_equal('#<TestObject1:0x2 ... @b , ... @d , ...>', string2) instance variables are output in lexicographical order > complexObject1 estObject1.new('1', {:a 1, :b 2, :j 3}, [1, 2, you seem to assume that hash keys are sorted before printing (which isn't always possible, but...) [I assumed hashes would always be sortable with sort {|a,b|a.to_s <