1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

Document `and=>'.

* module/ice-9/boot-9.scm (and=>): Add docstring.
* doc/ref/api-procedures.texi (Higher-Order Functions): Add `and=>'.
This commit is contained in:
Ludovic Courtès 2013-03-27 16:45:54 +01:00
parent ffc8eca636
commit 8cd109bf0a
2 changed files with 9 additions and 1 deletions

View file

@ -717,6 +717,11 @@ compatible arity.
Return X. Return X.
@end deffn @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 @node Procedure Properties
@subsection Procedure Properties and Meta-information @subsection Procedure Properties and Meta-information

View file

@ -944,7 +944,10 @@ VALUE."
(lambda _ (lambda _
value)) 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 call/cc call-with-current-continuation)
(define-syntax false-if-exception (define-syntax false-if-exception