Dear Daphne,

thanks for writing this SRFI! I like it!

Here are a few comments:

(1) The second procedure has the same name as the first "make-wrapper-comparator".  I think the second one should have gotten a different name, probably "make-composed-comparator".

(2) In the compose-comparator form, it would help a lot if you use the standard way of describing syntax (see the R6RS or R7RS document):

Syntax: (compose-comparator <type-test-expression> (<unwrap-expression> <comparator-expression>) ...)

Semantics: <Type-test-expression>, the <unwrap-expression> and <comparator-expressions> are evaluated in an unspecified order.  It is an error if the resulting value of ... etc... blabla...

(3) There are other procedures with a lot of return values, see SRFI 137, for example.  Keyword arguments are not really necessary thanks to Scheme's macros.  Make "comparison-procedures" syntax of the form

(comparison-procedures <comparator-expr> <cmp-identifier> ...)

Syntax: Each <cmp-identifier> is one of the identifiers "<", "<=", "=", ">=", ">".

Semantics: Evaluates <comparator-expr> to obtain a comparator.  Returns as much values as there are <cmp-identifiers>.  The return value corresponding to "<" ("<=", "=", ">=", ">", respectively) is the partial application of the SRFI 128 procedure "<?" ("<=?", ..., respectively) to the obtained comparator.

(4) Can you give a rationale why "comparison-procedures" is a useful abstraction when compared with a version that returns the comparators individually?

(5) Can you explain your idea about generator comparators?  Generators are generally "use-once" data types and infinite, so how is this supposed to work?

Thanks,

Marc

Am Mi., 1. Sept. 2021 um 02:01 Uhr schrieb John Cowan <xxxxxx@ccil.org>:
Nice.  I've added this to the Orange Docket, but if it gets stuck in the SRFI process it may get moved to a later docket.

On Tue, Aug 31, 2021 at 6:36 PM Arthur A. Gleckler <xxxxxx@speechcode.com> wrote:

Scheme Request for Implementation 228,
"A further comparator library,"
by Daphne Preston-Kendal,
is now available for discussion.

Its draft and an archive of the ongoing discussion are available at https://srfi.schemers.org/srfi-228/.

You can join the discussion of the draft by filling out the subscription form on that page.

You can contribute a message to the discussion by sending it to xxxxxx@srfi.schemers.org.

Here's the abstract:

Further procedures and syntax forms for defining SRFI 128 comparators, and for extracting comparison procedures similar to those defined for Scheme’s built-in types using them.

Best enjoyed in combination with SRFI 162.

Regards,


SRFI Editor