unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* currying
@ 2010-09-06 19:36 Eric J. Van der Velden
  2010-09-07 15:07 ` currying Thien-Thi Nguyen
  2010-09-07 20:20 ` currying Andy Wingo
  0 siblings, 2 replies; 3+ messages in thread
From: Eric J. Van der Velden @ 2010-09-06 19:36 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 1098 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-07 20:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-06 19:36 currying Eric J. Van der Velden
2010-09-07 15:07 ` currying Thien-Thi Nguyen
2010-09-07 20:20 ` currying Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).