make it so that (=? "hi" "hi") works Sandra Snan 25 May 2021 15:37 UTC

In SRFI-128, make it so that (=? "hi" "hi") works without having
to supply the default comparator as the first arg. That's why
there is a default and why you can register new defaults.

I know that (=? (make-default-comparator) "hi" "hi") works.
That's the problem, that it can't figure that out on its own.

This is already a variadic procedure.
(Since you can do (>? "hi" "hi" "hi").)

I mean ideally I would've not had that first argument in the first place, I'd just have (proc arg arg arg arg...) Instead of (proc comp arg arg arg) being an option.

So either for backwards compatibility dispatch using (comparator?) on
first arg (then if people wanna compare comparators, they can do it with
(>? comp comp comp) for example) or change the interface so that it does
not need that second argument but instead looks up the default.

Since people can register new default comparators, temporarily or
permanently.

♥

PS also here is a reason for the above:

It is a shame that these short and elegant names were clobbered.

(=? (here-is-how-i-get-to-a-useful-comparator) "hi" "hi")

is almost as cumbersome as  (string=?  "hi" "hi")