diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-06-17 16:59:50 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-06-17 17:25:23 +0200 |
commit | 0360843acee98f26598d8f77eda880a03ea3be93 (patch) | |
tree | 49420c3904cd029a9e85629d421acd818134d119 /doc/ref/srfi-modules.texi | |
parent | 2e2e13c40a38a399daf6466f95c8975600ab5ded (diff) | |
download | guile-0360843acee98f26598d8f77eda880a03ea3be93.tar.gz |
srfi-1: Rewrite 'find' in Scheme.
This halves the wall-clock time of:
guile -c '(use-modules (srfi srfi-1)) (define lst (make-list 100000000 1)) (find zero? lst)'
and yields an 18% speedup on:
guile -c '(use-modules (srfi srfi-1)) (define lst (make-list 100000000 1)) (find (lambda (x) (= 2 x)) lst)'
* libguile/srfi-1.c (scm_srfi1_find): Remove.
* libguile/srfi-1.h (scm_srfi1_find): Likewise.
* module/srfi/srfi-1.scm (find): New procedure.
* doc/ref/srfi-modules.texi (SRFI-1 Searching): Adjust docstring.
Diffstat (limited to 'doc/ref/srfi-modules.texi')
-rw-r--r-- | doc/ref/srfi-modules.texi | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi index 9de8396d7..2e66bafb9 100644 --- a/doc/ref/srfi-modules.texi +++ b/doc/ref/srfi-modules.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000-2004, 2006, 2007-2014, 2017, 2018, 2019 +@c Copyright (C) 1996, 1997, 2000-2004, 2006, 2007-2014, 2017, 2018, 2019, 2020 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -824,7 +824,7 @@ predicate or a comparison object for determining which elements are to be searched. @deffn {Scheme Procedure} find pred lst -Return the first element of @var{lst} which satisfies the predicate +Return the first element of @var{lst} that satisfies the predicate @var{pred} and @code{#f} if no such element is found. @end deffn |