DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(guile.info.gz) SRFI-1 Filtering and Partitioning

Info Catalog (guile.info.gz) SRFI-1 Fold and Map (guile.info.gz) SRFI-1 (guile.info.gz) SRFI-1 Searching
 
 39.3.6 Filtering and Partitioning
 ---------------------------------
 
 Filtering means to collect all elements from a list which satisfy a
 specific condition.  Partitioning a list means to make two groups of
 list elements, one which contains the elements satisfying a condition,
 and the other for the elements which don't.
 
  -- Scheme Procedure: filter pred lst
  -- Scheme Procedure: filter! pred lst
      Return a list containing all elements from LST which satisfy the
      predicate PRED.  The elements in the result list have the same
      order as in LST.  The order in which PRED is applied to the list
      elements is not specified.
 
      `filter!' is allowed, but not required to modify the structure of
 
  -- Scheme Procedure: partition pred lst
  -- Scheme Procedure: partition! pred lst
      Return two lists, one containing all elements from LST which
      satisfy the predicate PRED, and one list containing the elements
      which do not satisfy the predicated.  The elements in the result
      lists have the same order as in LST.  The order in which PRED is
      applied to the list elements is not specified.
 
      `partition!' is allowed, but not required to modify the structure
      of the input list.
 
  -- Scheme Procedure: remove pred lst
  -- Scheme Procedure: remove! pred lst
      Return a list containing all elements from LST which do not
      satisfy the predicate PRED.  The elements in the result list have
      the same order as in LST.  The order in which PRED is applied to
      the list elements is not specified.
 
      `remove!' is allowed, but not required to modify the structure of
      the input list.
 
Info Catalog (guile.info.gz) SRFI-1 Fold and Map (guile.info.gz) SRFI-1 (guile.info.gz) SRFI-1 Searching
automatically generated byinfo2html