From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric J. Van der Velden" Newsgroups: gmane.lisp.guile.user Subject: currying Date: Mon, 6 Sep 2010 21:36:58 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e0cb4e887e71590c23048f9c67ac X-Trace: dough.gmane.org 1283802059 18519 80.91.229.12 (6 Sep 2010 19:40:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Sep 2010 19:40:59 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Sep 06 21:40:57 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OshYh-0000kw-Ml for guile-user@m.gmane.org; Mon, 06 Sep 2010 21:40:51 +0200 Original-Received: from localhost ([127.0.0.1]:53332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OshV6-0004ge-33 for guile-user@m.gmane.org; Mon, 06 Sep 2010 15:37:08 -0400 Original-Received: from [140.186.70.92] (port=37723 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OshUy-0004f6-TF for guile-user@gnu.org; Mon, 06 Sep 2010 15:37:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OshUx-0007jZ-Mb for guile-user@gnu.org; Mon, 06 Sep 2010 15:37:00 -0400 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:38075) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OshUx-0007jP-KS for guile-user@gnu.org; Mon, 06 Sep 2010 15:36:59 -0400 Original-Received: by vws16 with SMTP id 16so4835714vws.0 for ; Mon, 06 Sep 2010 12:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=GiO6ModlR/+jybh27WwPCaxdkARSGpsM//O7DygoJB4=; b=fKDIfcALTu5JmUPxBPRk9wswCh1iAt9sCcKpnmjRsmTO5pP7FfITTYW5scTvWP12Rv fxQVJ25AQCinmoOY5Ut3i878qSkAgJy9Uh+GX3u6XCzxIhT7A759SFuacd2Lw3QUp7A9 hz2mTWb9GY2X/uWU4KQg1d+SIg+pODq0B66Ko= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=lKM/EpOmhxd2xPkWFDJ3uqVbasrVvyCeONXIp9+jluzLFiYVk/Z/OJdNzT1pAebpce L/E0SSYlN/FDqrgRyWMe+WBjlz2sBSbbw0KyaU/+wLSokG1ID12AGXDp+texcyP6vAko xFRq4Ft/IVK0Sx+iVscTweb+EvUwa4cZwQJ6A= Original-Received: by 10.220.128.198 with SMTP id l6mr394640vcs.219.1283801818401; Mon, 06 Sep 2010 12:36:58 -0700 (PDT) Original-Received: by 10.220.182.193 with HTTP; Mon, 6 Sep 2010 12:36:58 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8163 Archived-At: --e0cb4e887e71590c23048f9c67ac Content-Type: text/plain; charset=ISO-8859-1 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. --e0cb4e887e71590c23048f9c67ac Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

1.

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

(define compose(lambda(f)
=A0=A0=A0=A0=A0=A0=A0 (lambda(= g)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (lambda(x)
=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (f(g x))))))
(define not2
=A0=A0=A0=A0=A0=A0=A0 (compose not)
)

((not2 null?)'())
This is OK.

2.

I do this also,

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

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

(neither '()'())

This is OK.

3.

But= both here below are ERR,

(define neither
=A0=A0=A0=A0=A0=A0=A0 (= both ((compose not)) )

(define neither
=A0=A0=A0=A0=A0=A0=A0 (both (compose not))

Th= e first one doesn't compile. The second one does, but this is not what = I meant; It suspects two arguments, the '() '() for example , inste= ad of one, the funtion null? for example.

Can I define (neither) is some way that I can do something like

= =A0=A0=A0=A0=A0=A0=A0 ((neither null?)'(a)'(a))

Thanks,
<= br>Eric J.

--e0cb4e887e71590c23048f9c67ac--