From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#12341: define does not support lambda shorthand notation, define-public does Date: Wed, 05 Sep 2012 23:16:02 +0200 Message-ID: <87vcfsuq5p.fsf@gnu.org> References: <87ligrhti2.fsf@fencepost.gnu.org> <87zk56onnn.fsf@gnu.org> <87vcfu9dws.fsf@Kagami.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1346879846 13640 80.91.229.3 (5 Sep 2012 21:17:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Sep 2012 21:17:26 +0000 (UTC) Cc: 12341@debbugs.gnu.org, David Kastrup To: Ian Price Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Sep 05 23:17:27 2012 Return-path: Envelope-to: guile-bugs@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 1T9MyS-0004yk-RS for guile-bugs@m.gmane.org; Wed, 05 Sep 2012 23:17:25 +0200 Original-Received: from localhost ([::1]:42299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9MyP-0005Vq-PI for guile-bugs@m.gmane.org; Wed, 05 Sep 2012 17:17:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9MyA-0005Q8-JZ for bug-guile@gnu.org; Wed, 05 Sep 2012 17:17:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9Mxy-0005vJ-Fk for bug-guile@gnu.org; Wed, 05 Sep 2012 17:17:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Mxy-0005us-67 for bug-guile@gnu.org; Wed, 05 Sep 2012 17:16:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T9My6-0005sq-5N for bug-guile@gnu.org; Wed, 05 Sep 2012 17:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 05 Sep 2012 21:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12341 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 12341-submit@debbugs.gnu.org id=B12341.134687977522559 (code B ref 12341); Wed, 05 Sep 2012 21:17:02 +0000 Original-Received: (at 12341) by debbugs.gnu.org; 5 Sep 2012 21:16:15 +0000 Original-Received: from localhost ([127.0.0.1]:41320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T9MxL-0005rn-3s for submit@debbugs.gnu.org; Wed, 05 Sep 2012 17:16:15 -0400 Original-Received: from xanadu.aquilenet.fr ([88.191.123.111]:34739) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T9MxJ-0005rg-03 for 12341@debbugs.gnu.org; Wed, 05 Sep 2012 17:16:14 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id E3CBD90A7; Wed, 5 Sep 2012 23:16:03 +0200 (CEST) Original-Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1r1ZGcg36rzB; Wed, 5 Sep 2012 23:16:03 +0200 (CEST) Original-Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id 03A441165; Wed, 5 Sep 2012 23:16:02 +0200 (CEST) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Fructidor an 220 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87vcfu9dws.fsf@Kagami.home> (Ian Price's message of "Tue, 04 Sep 2012 13:21:39 +0100") User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6526 Archived-At: Hello, Ian Price skribis: > From fb23b4a49e9c1f5c15ef0ceb2ee1903ebfddd71a Mon Sep 17 00:00:00 2001 > From: Ian Price > Date: Tue, 4 Sep 2012 13:18:58 +0100 > Subject: [PATCH] `define-public' is no a longer curried definition by > default. > > * module/ice-9/boot-9.scm (define-public): Remove currying functionality. > * module/ice-9/curried-definitions.scm (define-public): New export. Looks good to me. You now have commit access, so you=E2=80=99re welcome to commit it by yours= elf! :-) Please post patches before committing, for a start. Make sure to always rebase before committing, to avoid gratuitous merge commits if somebody else pushed changes in the meantime. If you have any doubts with Git, please ask us. > David Kastrup writes: > >> I'd have expected a pointer at least somewhere (if not everywhere) among >> those links: >> >> >> >> > > I agree, and have provided some documentation. +1. > I'm no texinfo expert so it probably needs cleanup. In particular, I > wasn't sure of how to markup these curried forms. > From 6addaedac96ffe919d1b0cb58ed9992fbd240bf7 Mon Sep 17 00:00:00 2001 > From: Ian Price > Date: Tue, 4 Sep 2012 15:36:54 +0100 > Subject: [PATCH] Document (ice-9 curried definitions) > > * doc/ref/Makefile.am(guile_TEXINFOS): Add curried.texi to list > * doc/ref/curried.texi: New file. > * doc/ref/guile.texi(Guile Modules): Add "Curried Definitions" to menu. > * doc/ref/scheme-ideas.texi(Lambda Alternatives): Refer to "Curried Defin= itions" > from the `define' section. Please leave a space before opening parentheses. > +++ b/doc/ref/curried.texi > @@ -0,0 +1,53 @@ > +@c -*-texinfo-*- > +@c This is part of the GNU Guile Reference Manual. > +@c Copyright (C) 2012 > +@c Free Software Foundation, Inc. No newline. > +@node Curried Definitions > +@section Curried Definitions > + > +The macros in this section are provided by > +@lisp > +(use-modules (ice-9 curried-definitions)) > +@end lisp > +@noindent > +and replace those provided by default. > + > +Prior to guile 2, guile provided a type of definition known colloquially Should be =E2=80=9CGuile 2.0=E2=80=9D. > +as a ``curried definition''. The idea is to extend the syntax of > +@code{define} so that you can conveniently define procedures that return > +procedures, up to any desired depth. > + > +For example, > +@example > +(define ((foo x) y) > + (list x y)) > +@end example > +is a convenience form of > +@example > +(define foo > + (lambda (x) > + (lambda (y) > + (list x y)))) > +@end example > + > +@deffn {Syntax} define (@dots{} (name args @dots{}) @dots{}) expression = @dots{} It should be {Scheme Syntax}, for consistency with most of the manual. Instead of =E2=80=98expression=E2=80=99, what about =E2=80=98body @dots{}= =E2=80=99? Also, I wonder whether the parentheses should appear at all, since it also accepts the flat form. OTOH, the only things worth describing is the parenthesized form. > +A curried version of the default @code{define}. > +@end deffn Please use a more formal, present-tense description, like =E2=80=9CCreate a top-level variable @var{name} bound to the procedure defined by @var{args}. @var{args} may be a list of formal parameters, possibly including nested formal parameter lists, in which case a higher-order procedure is created, as in the example above.=E2=80=9D > +@deffn {Syntax} define* (@dots{} (name args @dots{}) @dots{}) expression= @dots{} Here =E2=80=98deffnx=E2=80=99 could be used instead, like: @deffn {Scheme Syntax} define (@dots{} (name args @dots{}) @dots{}) body = @dots{} @deffnx {Scheme Syntax} define* (@dots{} (name args @dots{}) @dots{}) bod= y @dots{} [...] @code{define*} works similarly, and accepts all the options that @code{lambda*} accepts (@pxref{lambda* and define*}). For example: @example [...] @end example @end deffn =20=20 > +@deffn {Syntax} define-public (@dots{} (name args @dots{}) @dots{}) expr= ession @dots{} @deffnx too? > +Prior to guile 2, guile provided an extension to @code{define} syntax =E2=80=9CGuile 2.0=E2=80=9D. Thanks! Ludo=E2=80=99.