DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(guile.info.gz) SRFI-1 Searching

Info Catalog (guile.info.gz) SRFI-1 Filtering and Partitioning (guile.info.gz) SRFI-1 (guile.info.gz) SRFI-1 Deleting
 
 39.3.7 Searching
 ----------------
 
 The procedures for searching elements in lists either accept a
 predicate or a comparison object for determining which elements are to
 be searched.
 
  -- Scheme Procedure: find pred lst
      Return the first element of LST which satisfies the predicate PRED
      and `#f' if no such element is found.
 
  -- Scheme Procedure: find-tail pred lst
      Return the first pair of LST whose CAR satisfies the predicate
      PRED and `#f' if no such element is found.
 
  -- Scheme Procedure: take-while pred lst
  -- Scheme Procedure: take-while! pred lst
      Return the longest initial prefix of LST whose elements all
      satisfy the predicate PRED.
 
      `take-while!' is allowed, but not required to modify the input
      list while producing the result.
 
  -- Scheme Procedure: drop-while pred lst
      Drop the longest initial prefix of LST whose elements all satisfy
      the predicate PRED.
 
  -- Scheme Procedure: span pred lst
  -- Scheme Procedure: span! pred lst
  -- Scheme Procedure: break pred lst
  -- Scheme Procedure: break! pred lst
      `span' splits the list LST into the longest initial prefix whose
      elements all satisfy the predicate PRED, and the remaining tail.
      `break' inverts the sense of the predicate.
 
      `span!' and `break!' are allowed, but not required to modify the
      structure of the input list LST in order to produce the result.
 
  -- Scheme Procedure: any pred lst1 lst2 ...
      Apply PRED across the lists and return a true value if the
      predicate returns true for any of the list elements(s); return
      `#f' otherwise.  The true value returned is always the result of
      the first successful application of PRED.
 
  -- Scheme Procedure: every pred lst1 lst2 ...
      Apply PRED across the lists and return a true value if the
      predicate returns true for every of the list elements(s); return
      `#f' otherwise.  The true value returned is always the result of
      the final successful application of PRED.
 
  -- Scheme Procedure: list-index pred lst1 lst2 ...
      Return the index of the leftmost element that satisfies PRED.
 
  -- Scheme Procedure: member x lst [=]
      Return the first sublist of LST whose CAR is equal to X.  If X
      does no appear in LST, return `#f'.  Equality is determined by the
      equality predicate =, or `equal?' if = is not given.
 
Info Catalog (guile.info.gz) SRFI-1 Filtering and Partitioning (guile.info.gz) SRFI-1 (guile.info.gz) SRFI-1 Deleting
automatically generated byinfo2html