DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(guile.info.gz) SRFI-13 Fold/Unfold/Map

Info Catalog (guile.info.gz) SRFI-13 Reverse/Append (guile.info.gz) SRFI-13 (guile.info.gz) SRFI-13 Replicate/Rotate
 
 39.11.12 Fold/Unfold/Map
 ------------------------
 
 `string-map', `string-for-each' etc. are for iterating over the
 characters a string is composed of.  The fold and unfold procedures are
 list iterators and constructors.
 
  -- Scheme Procedure: string-map proc s [start end]
      PROC is a char->char procedure, it is mapped over S.  The order in
      which the procedure is applied to the string elements is not
      specified.
 
  -- Scheme Procedure: string-map! proc s [start end]
      PROC is a char->char procedure, it is mapped over S.  The order in
      which the procedure is applied to the string elements is not
      specified.  The string S is modified in-place, the return value is
      not specified.
 
  -- Scheme Procedure: string-fold kons knil s [start end]
  -- Scheme Procedure: string-fold-right kons knil s [start end]
      Fold KONS over the characters of S, with KNIL as the terminating
      element, from left to right (or right to left, for
      `string-fold-right').  KONS must expect two arguments: The actual
      character and the last result of KONS' application.
 
  -- Scheme Procedure: string-unfold p f g seed [base make_final]
  -- Scheme Procedure: string-unfold-right p f g seed [base make_final]
      These are the fundamental string constructors.
         * G is used to generate a series of _seed_ values from the
           initial SEED: SEED, (G SEED), (G^2 SEED), (G^3 SEED), ...
 
         * P tells us when to stop - when it returns true when applied
           to one of these seed values.
 
         * F maps each seed value to the corresponding character in the
           result string.  These chars are assembled into the string in
           a left-to-right (right-to-left) order.
 
         * BASE is the optional initial/leftmost (rightmost)  portion of
           the constructed string; it default to the empty string.
 
         * MAKE_FINAL is applied to the terminal seed value (on which P
           returns true) to produce the final/rightmost (leftmost)
           portion of the constructed string.  It defaults to `(lambda
           (x) "")'.
 
  -- Scheme Procedure: string-for-each proc s [start end]
      PROC is mapped over S in left-to-right order.  The return value is
      not specified.
 
Info Catalog (guile.info.gz) SRFI-13 Reverse/Append (guile.info.gz) SRFI-13 (guile.info.gz) SRFI-13 Replicate/Rotate
automatically generated byinfo2html