mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 00:30:21 +02:00
(SRFI-1 Filtering and Partitioning): For partition
and partition!, emphasise the multi-value return, note partition may share a tail with the given list.
This commit is contained in:
parent
ea6ea01bca
commit
193239f1e9
1 changed files with 17 additions and 7 deletions
|
@ -599,14 +599,20 @@ Guile core, @xref{List Modification}.
|
||||||
|
|
||||||
@deffn {Scheme Procedure} partition pred lst
|
@deffn {Scheme Procedure} partition pred lst
|
||||||
@deffnx {Scheme Procedure} partition! pred lst
|
@deffnx {Scheme Procedure} partition! pred lst
|
||||||
Return two lists, one containing all elements from @var{lst} which
|
Split @var{lst} into those elements which do and don't satisfy the
|
||||||
satisfy the predicate @var{pred}, and one list containing the elements
|
predicate @var{pred}.
|
||||||
which do not satisfy the predicated. The elements in the result lists
|
|
||||||
have the same order as in @var{lst}. The order in which @var{pred} is
|
|
||||||
applied to the list elements is not specified.
|
|
||||||
|
|
||||||
@code{partition!} is allowed, but not required to modify the structure of
|
The return is two values (@pxref{Multiple Values}), the first being a
|
||||||
the input list.
|
list of all elements from @var{lst} which satisfy @var{pred}, the
|
||||||
|
second a list of those which do not.
|
||||||
|
|
||||||
|
The elements in the result lists are in the same order as in @var{lst}
|
||||||
|
but the order in which the calls @code{(@var{pred} elem)} are made on
|
||||||
|
the list elements is unspecified.
|
||||||
|
|
||||||
|
@code{partition} does not change @var{lst}, but one of the returned
|
||||||
|
lists may share a tail with it. @code{partition!} may modify
|
||||||
|
@var{lst} to construct its return.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} remove pred lst
|
@deffn {Scheme Procedure} remove pred lst
|
||||||
|
@ -2922,3 +2928,7 @@ change in the future.
|
||||||
|
|
||||||
|
|
||||||
@c srfi-modules.texi ends here
|
@c srfi-modules.texi ends here
|
||||||
|
|
||||||
|
@c Local Variables:
|
||||||
|
@c TeX-master: "guile.texi"
|
||||||
|
@c End:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue