This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Kawa numbers are now Comparable


I checked into CVS patches to make the standard
Kawa number classes implement Comparable.  So you
can now do things like:

(set! v (vector 1 0.5 5/2 8 2.5))
(java.util.Collections:sort v)

The implementation isn't 100% consistent with equals,
as I decided it makes sense to allow comparing
rational numbers with floating-point numbers, even
though they're not equals.

Let me know if you find any anomalies or bugs.

Next I'd like to let Symbol be comparable (but
only with they have the same Environment/namespace),
gnu.text.Char aka <char>
and some subset of the gnu.lists classes.  Any opinions
on what makes most sense / is most useful?  I think
that FString aka <string> should be Comparable, but
other gnu.lists.Sequence classes are less clear.
One could make a case for FVector aka <vector> as
well as LList aka <list> and perhaps SimpleVector
(which would automatically cover FVector as well the
various uniform vector types - though inefficiently).
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]