Re: Bisection functions should take a comparator argument
Alex Shinn 16 Mar 2021 13:42 UTC
On Tue, Mar 16, 2021 at 4:52 PM Marc Nieper-Wißkirchen
<xxxxxx@nieper-wisskirchen.de> wrote:
>
> Am Di., 16. März 2021 um 08:24 Uhr schrieb Daphne Preston-Kendal <xxxxxx@nonceword.org>:
>>
>> They do — the ‘less?’ argument. These procedures can also be used with comparators in the SRFI 128 sense quite easily: just pass the comparator-ordering-predicate of the comparator as the ‘less?’ argument.
>
>
> The general philosophy seems to have been lately not to use bare ordering predicates in public APIs but to always accept comparators.
I think that only makes sense for those few APIs where either an
ordering or hash could be applicable.
Otherwise it's extra complexity and boilerplate to wrap a custom
`less?' in a dummy comparator.
--
Alex