From: Trans Date: 2006-09-03T04:35:34+09:00 Subject: Re: Ordered contrast for String or Array Trans wrote: > [ "a", "a", "b", "c" ].contrast => [ nil, nil, "b", nil ] > [ "a", "a", "b", "c" ].ordered_contrast => [ nil, nil, "b","c" ] > > [ "a", "a", "b", "c" ].intersect => [ "a", "a", nil, "c" ] > [ "a", "a", "b", "c" ].ordered_intersect => [ "a", "a", nil, nil ] Opps... I forgot the comparision array and screwed it up. Let me try that again: [ "a", "a", "b", "c" ].contrast([ "a", "a", "c", "c" ]) => [ nil, nil, "c", nil ] [ "a", "a", "b", "c" ].ordered_contrast([ "a", "a", "c", "c" ]) => [ nil, nil, "c","c" ] In these the difference being show is that of the parameter's. If we swap the receiver and the parameter: [ "a", "a", "c", "c" ].contrast([ "a", "a", "b", "c" ]) => [ nil, nil, "b", nil ] [ "a", "a", "c", "c" ].ordered_contrast([ "a", "a", "b", "c" ]) => [ nil, nil, "b","c" ] And of course the inverse: [ "a", "a", "b", "c" ].intersect([ "a", "a", "c", "c" ]) => [ "a", "a", nil, "c" ] [ "a", "a", "b", "c" ].ordered_intersect([ "a", "a", "c", "c" ]) => [ "a", "a", nil, nil ] Also interesting: [ "a", "a", "b", "c" ].contrast([ "a", "a", "c", "c" ]) => [ nil, nil, "c", nil ] [ nil, nil, "c", nil ].contrast([ "a", "a", "c", "c" ]) => [ "a", "a", nil, "c" ] which is the intersection. T.