guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

currying


From: Eric J. Van der Velden
Subject: currying
Date: Mon, 6 Sep 2010 21:36:58 +0200

Hello,

1.

I have curried (compose) so that I can define (not2) below,

(define compose(lambda(f)
        (lambda(g)
                (lambda(x)
                        (f(g x))))))

(define not2
        (compose not)
)

((not2 null?)'())

This is OK.

2.

I do this also,

(define both(lambda(f)
        (lambda(a b)
                (and(f a)(f b))
        )
))

(define neithernull
        (both ((compose not)null?) )
)

(neither '()'())

This is OK.

3.

But both here below are ERR,

(define neither
        (both ((compose not)) )

(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))

Thanks,

Eric J.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]