Derick Eddington wrote:
An issue with yours and mine is that all the predicates must have the
same arity. Ours cannot do something like
(lambda (x y) (and (foo? x y) (bar? x) (zab? y)))
Right, there's always a time and a place for lambda.
In the FP-style, you use higher-order functions to transform the input
procedures:
> (import (dharmalab combinators macros))
> (import (dharmalab combinators concatenative))
> (import (dharmalab combinators short-circuit-macros))
> (&& (> (drop odd?) (nip even?)) (x y))
#<procedure>
> ( (&& (> (drop/2 odd?) (nip even?)) (x y)) 5 4 )
#t
> ( (&& (> (drop/2 odd?) (nip even?)) (x y)) 5 3 )
#f
>
Ed