SRFI 235 review Wolfgang Corcoran-Mathe 03 Sep 2022 13:51 UTC
Hi John, Arvydas, and the SRFI 235 list,

Below are some comments and questions I have about the SRFI.  I've
also attached a patch (against John's repo) which fixes some minor
typos.

1. Can (complement proc) return #f if proc returns multiple values?

2. Why include both 'swap' and 'flip'?  The sample implementation
of 'swap' (srfi/235-impl.scm, line 9) differs from the spec. in that
the returned procedure accepts a "rest" argument:

(define (swap proc)
  (lambda (obj1 obj2 . rest)
    (apply proc obj2 obj1 rest)))

Is this the behavior you intend?

3. Minor clarifications: Is (conjoin) equivalent to (constantly #t)?
Is (disjoin) equivalent to (constantly #f)?

4. The 'all-of' and 'some-of' sample implementations don't return
the predicate's truthy value.

5. The spec. of 'on' is ambiguous.  mapper is applied "to each obj
in any order", then reducer is applied to the results--but in what
order?  The example doesn't settle this, since the reducer (+) is
commutative.

6. What happens if (on f g) is applied to no arguments?

7. Is (apply-chain) equivalent to (apply-chain values)?  If not,
what happens?

8. The example for 'case-procedure' lacks an else-thunk.

9. Major suggestion: Would it be reasonable for all of the
syntax-like procedures to accept thunks *or* promises?  I believe
this could be very useful, although the names might need tweaking.

Delayed evaluation always gets short shrift in Scheme.  It would
be a sad statement of the current situation for something called
"lazy-and-procedure" to have nothing to do with delayed evaluation.

Regards, Wolf

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>