ISTR that several lisp dialects have had comparators that accept
zero or more arguments. In those cases the 0 and 1 argument cases
of comparators have, IIRC, been considered TRUE.
It has to do with a recursive implementation where the zero-argument
or single-argument case is the base case.
;; be wary of bugs in this code; I am typing it from memory
;; and have not tested it.
(define gencomp? (lambda (paircomp?)
(define comp? (lambda arglist
(cond ((empty-list? arglist) #t)
((empty-list? (cdr arglist) #t)
((paircomp? (car arglist) (cadr arglist))
(comp? (cdr arglist)))
(else #f))))))
allows definition of all general comparisons as a function of the
corresponding pairwise comparisons. I remember being somewhat
surprised when I saw the arity requirements in R4RS.
Bear
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss