From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user Subject: Re: and-let* is not composable? Date: Wed, 11 Sep 2013 14:25:07 +0200 Message-ID: References: <87li34mue7.fsf@Kagami.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3b9443ea90904e61ab638 X-Trace: ger.gmane.org 1378902322 18123 80.91.229.3 (11 Sep 2013 12:25:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Sep 2013 12:25:22 +0000 (UTC) To: Panicz Maciej Godek , "guile-user@gnu.org" , Ian Price Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Sep 11 14:25:25 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VJjU4-0004Dn-6b for guile-user@m.gmane.org; Wed, 11 Sep 2013 14:25:24 +0200 Original-Received: from localhost ([::1]:35502 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJjU3-00005u-OR for guile-user@m.gmane.org; Wed, 11 Sep 2013 08:25:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJjTq-0008U5-F0 for guile-user@gnu.org; Wed, 11 Sep 2013 08:25:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJjTo-0004H5-QB for guile-user@gnu.org; Wed, 11 Sep 2013 08:25:10 -0400 Original-Received: from mail-vb0-x232.google.com ([2607:f8b0:400c:c02::232]:46604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJjTo-0004GQ-KO for guile-user@gnu.org; Wed, 11 Sep 2013 08:25:08 -0400 Original-Received: by mail-vb0-f50.google.com with SMTP id x14so5933427vbb.37 for ; Wed, 11 Sep 2013 05:25:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=x4ZTfU08Ngixp7kVgLQbFnDyRTsM8LqsptIFeS7CODk=; b=Xt17+twOCQ/CRljpSIu70IUg1l5CEACV9GIic2MiIWSyW188tdekvnDR/3BI1N+0SN nZpuCsStarqa6OvnbgEKuyo3SA0LZ6dewnoobA/6tupMCo9wekPlsZGBCHxdmfDkh+EN Ta/PkkelMljyUeCgkaRTvcLuJJDS5F1ewbLtPHeCgUBwBjm64u+6QhQh4fBEJ7CLf3Ev Lbpjxqqz3P2uNhUb3F09QSGKyeijn2Xoo8qxw5QjX1SSmZlciDom17KyIJ9nxG6tNTSU yV0Fk6xZdU5hEImqZZgAti2c85Zqzvy7hHsU62Nc+rzkpbIcCXJH3yTYDle0nO+8Uswm gwRg== X-Received: by 10.220.10.194 with SMTP id q2mr1042123vcq.2.1378902307927; Wed, 11 Sep 2013 05:25:07 -0700 (PDT) Original-Received: by 10.221.45.135 with HTTP; Wed, 11 Sep 2013 05:25:07 -0700 (PDT) In-Reply-To: <87li34mue7.fsf@Kagami.home> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c02::232 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10793 Archived-At: --001a11c3b9443ea90904e61ab638 Content-Type: text/plain; charset=ISO-8859-1 2013/9/10 Ian Price > > I have a few notes unrelated to those I've already mentioned in the > thread. > > 1. Guile already has curried definitions in (ice-9 curried-definitions) > > Yes, but those are completely different. I wouldn't call "define-curried" a curried definition, but a definition of a curried macro for generating procedures. > 2. By turning your functions definitions into a macro, you've lost the > ability to use them in a first class manner. > > That's not entirely true. I just need an extra pair of parentheses to do so. The semantics is certainly different than the one of Guile's curried definitions, but that's fine. > 3. I would strongly recommend _not_ using define-macro, and even more > so, not mixing define-macro and syntax-rules in a macro. Syntax-case is > as powerful as defmacro, and in most practical cases, about as much > writing. > Well, while syntax-rules macros are quite easy to understand (at least from the user's point of view), although sometimes a little tricky, the syntax-case system I find still too difficult to use. define-macro, on the other hand, is very easy to explain even to beginner programmers, although the resulting macros are much more difficult to analyse. The main problem with syntax-rules/syntax-case macros is the treatment of ellipses, which makes it difficult to create macros that create macros. Still, I didn't post to comp.lang.scheme for no reason :) 4. What your macro does is not currying, it is partial > application. Those are different things. Currying refers to the process > of turning a function of n arguments into an n-nested set of 1 argument > functions. Partial application is, well, not supplying all the arguments > to a function. You can have partial application without currying, as > your macro shows. > OK, you got me here. But it's still difficult for me to come up with a good name for that macro (and if so, the Guile's curried definitions are not curried either, at least in general: because you can (define ((f a b) c d) ...), getting a chain of 2-argument functions) Thanks, M. --001a11c3b9443ea90904e61ab638 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

= 2013/9/10 Ian Price <ianprice90@googlemail.com>
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
I have a few notes unrelated to those I've already mentioned in the
thread.

1. Guile already has curried definitions in (ice-9 curried-definitions)

Yes, but those are completely different. I wouldn'= ;t call "define-curried"
a curried definition, but a de= finition of a curried macro for generating
procedures.
=A0
2. By turning your functions definitions into a macro, you've lost the<= br> ability to use them in a first class manner.

That's not entirely true. I just need an extra pa= ir of parentheses
to do so. The semantics is certainly different = than the one of
Guile's curried definitions, but that's f= ine.
=A0
3. I would strongly recommend _not_ using define-macro, and even more
so, not mixing define-macro and syntax-rules in a macro. Syntax-case is
as powerful as defmacro, and in most practical cases, about as much
writing.

Well, while syntax-rules macro= s are quite easy to understand
(at least from the user's poin= t of view), although sometimes a little
tricky, the syntax-case s= ystem I find still too difficult to use.
define-macro, on the other hand, is very easy to explain
eve= n to beginner programmers, although the resulting macros
are much= more difficult to analyse.
The main problem with syntax-rules/sy= ntax-case macros is
the treatment of ellipses, which makes it difficult to create
macros that create macros.
Still, I didn't post to comp.lan= g.scheme for no reason :)


=
OK, you got me here. But it's still di= fficult for me to come up
with a good name = for that macro (and if so, the Guile's curried
definitions are not curried either, at least in = general: because
you can (define ((f a b) c= d) ...), getting a chain of 2-argument
fun= ctions)

Thanks,
M.

<= /div> --001a11c3b9443ea90904e61ab638--