Is there a dyad that returns -1 for string x less than string y, 1 for x
greater than y, and 0 for x equals y?
-: Almost does this, but it only tests equality; it's not specific enough
to tell you whether x or y is greater. Instead it just returns 0 for not
equal and 1 for equal.
The compare dyad almost does this, but with an API with complexity on the
order of diff or subversion.
'abc' compare 'def'
0 [0] abc
1 [0] def
'abc' compare 'abc'
no difference
In a conditional you would have to use (('abc' compare 'abc') compare 'no
difference') compare 'no difference' ad infinitum just to see if there was
'no difference' in the original compare!
Cheers,
Andrew Pennebaker
www.yellosoft.us
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm