diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-03-27 16:45:54 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-03-27 18:09:49 +0100 |
commit | 8cd109bf0a10e37c26bf476fed81a0d4282d13c6 (patch) | |
tree | af109b40c1938705126ba9864976848122dc2763 | |
parent | ffc8eca636a8e9311d35c9adba2fc80476ab11ca (diff) | |
download | guile-8cd109bf0a10e37c26bf476fed81a0d4282d13c6.tar.gz |
Document `and=>'.
* module/ice-9/boot-9.scm (and=>): Add docstring.
* doc/ref/api-procedures.texi (Higher-Order Functions): Add `and=>'.
-rw-r--r-- | doc/ref/api-procedures.texi | 5 | ||||
-rw-r--r-- | module/ice-9/boot-9.scm | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/ref/api-procedures.texi b/doc/ref/api-procedures.texi index e0158fd09..8ff240a14 100644 --- a/doc/ref/api-procedures.texi +++ b/doc/ref/api-procedures.texi @@ -717,6 +717,11 @@ compatible arity. Return X. @end deffn +@deffn {Scheme Procedure} and=> value proc +When @var{value} is @code{#f}, return @code{#f}. Otherwise, return +@code{(@var{proc} @var{value})}. +@end deffn + @node Procedure Properties @subsection Procedure Properties and Meta-information diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index ced3a2841..8461ee80d 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -944,7 +944,10 @@ VALUE." (lambda _ value)) -(define (and=> value procedure) (and value (procedure value))) +(define (and=> value procedure) + "When VALUE is #f, return #f. Otherwise, return (PROC VALUE)." + (and value (procedure value))) + (define call/cc call-with-current-continuation) (define-syntax false-if-exception |