On Oct 28, 2011, at 1:23 PM, Joe Marshall wrote: > On the other hand, providing code to demonstrate a particular way > of generalizing may carry more weight than a simple assertion of > incorrectness. But I could be wrong here as well.
OK, here's a variant of "binary->nary" that produces the results we want when "op" has contract "X X -> boolean" rather than "X X -> X" (define (binary->nary relop) (letrec ((f (lambda args (or (empty? args) (empty? (rest args)) (and (relop (first args) (second args)) (apply f (rest args))))))) f)) This applies relop to each successive (overlapping) pair of elements and "and"s the results. Stephen Bloch sbl...@adelphi.edu _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users