New release of SRFI 114 with implementation John Cowan (04 Dec 2013 04:16 UTC)
Re: New release of SRFI 114 with implementation Arthur A. Gleckler (04 Dec 2013 05:52 UTC)
Re: New release of SRFI 114 with implementation John Cowan (04 Dec 2013 20:28 UTC)
Re: New release of SRFI 114 with implementation Michael Sperber (04 Dec 2013 08:38 UTC)
Re: New release of SRFI 114 with implementation John Cowan (04 Dec 2013 13:52 UTC)
Re: New release of SRFI 114 with implementation Shiro Kawai (04 Dec 2013 13:54 UTC)
Re: New release of SRFI 114 with implementation John Cowan (04 Dec 2013 20:49 UTC)
Re: New release of SRFI 114 with implementation Shiro Kawai (04 Dec 2013 23:46 UTC)
Re: New release of SRFI 114 with implementation John Cowan (05 Dec 2013 18:35 UTC)
Re: New release of SRFI 114 with implementation Shiro Kawai (05 Dec 2013 22:08 UTC)
Re: New release of SRFI 114 with implementation Kevin Wortman (08 Dec 2013 02:32 UTC)
Re: New release of SRFI 114 with implementation John Cowan (08 Dec 2013 03:13 UTC)
Re: New release of SRFI 114 with implementation Kevin Wortman (08 Dec 2013 03:45 UTC)
Re: New release of SRFI 114 with implementation John Cowan (08 Dec 2013 17:01 UTC)
Re: New release of SRFI 114 with implementation Kevin Wortman (09 Dec 2013 00:10 UTC)
Re: New release of SRFI 114 with implementation John Cowan (09 Dec 2013 00:30 UTC)

Re: New release of SRFI 114 with implementation John Cowan 08 Dec 2013 17:01 UTC

Kevin Wortman scripsit:

> Returning the first tied argument seems like it would be a little more
> straightforward to implement, at least to me. But I'm comfortable with
> the current behavior. I don't think it matters much as long as the
> behavior is documented.

Here's the current sample implementation (note that it depends on `apply`
calling its argument tail-recursively):

(define comparator-min
  (case-lambda
    ((comparator a)
      a)
    ((comparator a b)
     (if (<? comparator a b) a b))
    ((comparator a b . objs)
     (comparator-min comparator a (apply comparator-min comparator b objs)))))

(define comparator-max
  (case-lambda
    ((comparator a)
      a)
    ((comparator a b)
     (if (>? comparator a b) a b))
    ((comparator a b . objs)
     (comparator-max comparator a (apply comparator-max comparator b objs)))))

Exactly what you get depends on which predicate you use, of course.

--
John Cowan    http://ccil.org/~cowan    xxxxxx@ccil.org
[T]here is a Darwinian explanation for the refusal to accept Darwin.
Given the very pessimistic conclusions about moral purpose to which his
theory drives us, and given the importance of a sense of moral purpose
in helping us cope with life, a refusal to believe Darwin's theory may
have important survival value. --Ian Johnston