Open shirok opened 2 weeks ago
Comparing classes sometimes work:
gosh> (compare <integer> <string>) -1
But sometimes not:
gosh> (compare <integer> <real>) *** ERROR: Object #<class <integer>> and #<class <real>> are not comparable
This has to do the fact that metaclass hierarchy. When (class-of x) and (class-of y) has a subtype relationship, compare calls the superclass's built-in compare callback. Otherwise, it uses the fallback code.
(class-of x)
(class-of y)
compare
Comparing classes sometimes work:
But sometimes not: