[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.6-25-g985538
From: |
Ian Price |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.6-25-g9855388 |
Date: |
Thu, 06 Sep 2012 21:15:56 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=985538837806ab8dadfe3c01388355b9f551a303
The branch, stable-2.0 has been updated
via 985538837806ab8dadfe3c01388355b9f551a303 (commit)
from 4aaceda29fc70124e64397c1593dc07a3a73a463 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 985538837806ab8dadfe3c01388355b9f551a303
Author: Ian Price <address@hidden>
Date: Thu Sep 6 21:21:47 2012 +0100
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
Definitions"
from the `define' section.
-----------------------------------------------------------------------
Summary of changes:
doc/ref/Makefile.am | 1 +
doc/ref/curried.texi | 56 +++++++++++++++++++++++++++++++++++++++++++++
doc/ref/guile.texi | 2 +
doc/ref/scheme-ideas.texi | 5 ++++
4 files changed, 64 insertions(+), 0 deletions(-)
create mode 100644 doc/ref/curried.texi
diff --git a/doc/ref/Makefile.am b/doc/ref/Makefile.am
index abe9cb9..201ab6b 100644
--- a/doc/ref/Makefile.am
+++ b/doc/ref/Makefile.am
@@ -62,6 +62,7 @@ guile_TEXINFOS = preface.texi \
web.texi \
expect.texi \
scsh.texi \
+ curried.texi \
sxml-match.texi \
scheme-scripts.texi \
api-overview.texi \
diff --git a/doc/ref/curried.texi b/doc/ref/curried.texi
new file mode 100644
index 0000000..25430b4
--- /dev/null
+++ b/doc/ref/curried.texi
@@ -0,0 +1,56 @@
address@hidden -*-texinfo-*-
address@hidden This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C) 2012 Free Software Foundation, Inc.
address@hidden See the file guile.texi for copying conditions.
+
address@hidden Curried Definitions
address@hidden Curried Definitions
+
+The macros in this section are provided by
address@hidden
+(use-modules (ice-9 curried-definitions))
address@hidden lisp
address@hidden
+and replace those provided by default.
+
+Prior to Guile 2.0, Guile provided a type of definition known colloquially
+as a ``curried definition''. The idea is to extend the syntax of
address@hidden so that you can conveniently define procedures that return
+procedures, up to any desired depth.
+
+For example,
address@hidden
+(define ((foo x) y)
+ (list x y))
address@hidden example
+is a convenience form of
address@hidden
+(define foo
+ (lambda (x)
+ (lambda (y)
+ (list x y))))
address@hidden example
+
address@hidden {Scheme Syntax} define (@dots{} (name args @dots{}) @dots{})
body @dots{}
address@hidden {Scheme Syntax} define* (@dots{} (name args @dots{}) @dots{})
body @dots{}
address@hidden {Scheme Syntax} define-public (@dots{} (name args @dots{})
@dots{}) body @dots{}
+
+Create a top level variable @var{name} bound to the procedure with
+parameter list @var{args}. If @var{name} is itself a formal parameter
+list, then a higher order procedure is created using that
+formal-parameter list, and returning a procedure that has parameter list
address@hidden This nesting may occur to arbitrary depth.
+
address@hidden is similar but the formal parameter lists take additional
+options as described in @ref{lambda* and define*}. For example,
address@hidden
+(define* ((foo #:keys (bar 'baz) (quux 'zot)) frotz #:rest rest)
+ (list bar quux frotz rest))
+
+((foo #:quux 'foo) 1 2 3 4 5)
address@hidden (baz foo 1 (2 3 4 5))
address@hidden example
+
address@hidden is similar to @code{define} but it also adds
address@hidden to the list of exported bindings of the current module.
address@hidden deffn
diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi
index c3da0c3..a1b3fe6 100644
--- a/doc/ref/guile.texi
+++ b/doc/ref/guile.texi
@@ -370,6 +370,7 @@ available through both Scheme and C interfaces.
* Expect:: Controlling interactive programs with Guile.
* sxml-match:: Pattern matching of SXML.
* The Scheme shell (scsh):: Using scsh interfaces in Guile.
+* Curried Definitions:: Extended @code{define} syntax.
@end menu
@include slib.texi
@@ -387,6 +388,7 @@ available through both Scheme and C interfaces.
@include sxml-match.texi
@include scsh.texi
address@hidden curried.texi
@node Standard Library
@chapter Standard Library
diff --git a/doc/ref/scheme-ideas.texi b/doc/ref/scheme-ideas.texi
index 53f7b61..15cf664 100644
--- a/doc/ref/scheme-ideas.texi
+++ b/doc/ref/scheme-ideas.texi
@@ -476,6 +476,11 @@ The corresponding forms of the alternative @code{define}
syntax are:
@noindent
For details on how these forms work, see @xref{Lambda}.
+Prior to Guile 2.0, Guile provided an extension to @code{define} syntax
+that allowed you to nest the previous extension up to an arbitrary
+depth. These are no longer provided by default, and instead have been
+moved to @ref{Curried Definitions}
+
(It could be argued that the alternative @code{define} forms are rather
confusing, especially for newcomers to the Scheme language, as they hide
both the role of @code{lambda} and the fact that procedures are values
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.6-25-g9855388,
Ian Price <=