Comparison of compound objects



Currently, Maxima cannot compare strings or lists using is(x<y):

        is(    "a"<"b"  )    => unable to evaluate predicate
        is(  [1] < [2]   )    => unable to evaluate predicate
        is( [1] < [1,.2] )   => arguments with incompatible structure
                (even an error with prederror:false )

I think it would be useful to extend "<" to these cases in the natural
way, using lexicographic ordering for lists/vectors.  There are two
arguments I can think of against this:

1) Vector norm might be a more natural mathematical comparison.  But
vector norm comparison does not obey trichotomy: [1,2] and [2,1] have
the same vector norm, but are not equal.  Normal mathematical notation
explicitly uses the norm in this case, and it is easy enough to put
in.  Are there other comparisons that might be more useful as the
normal meaning for "<"?

2) It might cause some programming errors to not be caught. (I usually
make this argument in cases like this.) But I don't think that this is
a strong argument in this case.  Comparing scalars and vectors, e.g.
is (3 < [3]), would remain an error.

Thoughts?

           -s