() "Eric J. Van der Velden" <[email protected]>
() Mon, 6 Sep 2010 21:36:58 +0200
(define neither
(both (compose not))
The first one doesn't compile. The second one does, but this is
not what I meant; It suspects two arguments, the '() '() for
example, instead of one, the funtion null? for example.
Can I define (neither) is some way that I can do something like
((neither null?)'(a)'(a))
Presuming that you'd like this expression to have value #t, try:
(define neither
(lambda (p?)
(both ((compose not) p?))))
aka
(define (neither p?)
(both ((compose not) p?)))
Style nit: i somewhat dislike the one-arg ‘compose’. IMHO, the
procedure most befitting that name should take any number of args,
including zero. That complicates the implementation, but such is
life on the edge of the knife...