diff --git a/femtolisp/equal.c b/femtolisp/equal.c index 59af998..d40548c 100644 --- a/femtolisp/equal.c +++ b/femtolisp/equal.c @@ -79,10 +79,13 @@ static value_t bounded_compare(value_t a, value_t b, int bound, int eq) return bounded_vector_compare(a, b, bound, eq); break; case TAG_CPRIM: - if (cp_class((cprim_t*)ptr(a)) == wchartype && - (!iscprim(b) || - cp_class((cprim_t*)ptr(b)) != wchartype)) - return fixnum(-1); + if (cp_class((cprim_t*)ptr(a)) == wchartype) { + if (!iscprim(b) || cp_class((cprim_t*)ptr(b)) != wchartype) + return fixnum(-1); + } + else if (iscprim(b) && cp_class((cprim_t*)ptr(b)) == wchartype) { + return fixnum(1); + } c = numeric_compare(a, b, eq, 1, NULL); if (c != 2) return fixnum(c);