DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(guile.info.gz) SRFI-14 Iterating Over Character Sets

Info Catalog (guile.info.gz) SRFI-14 Predicates/Comparison (guile.info.gz) SRFI-14 (guile.info.gz) SRFI-14 Creating Character Sets
 
 39.12.4 Iterating Over Character Sets
 -------------------------------------
 
 Character set cursors are a means for iterating over the members of a
 character sets.  After creating a character set cursor with
 `char-set-cursor', a cursor can be dereferenced with `char-set-ref',
 advanced to the next member with `char-set-cursor-next'.  Whether a
 cursor has passed past the last element of the set can be checked with
 `end-of-char-set?'.
 
    Additionally, mapping and (un-)folding procedures for character sets
 are provided.
 
  -- Scheme Procedure: char-set-cursor cs
      Return a cursor into the character set CS.
 
  -- Scheme Procedure: char-set-ref cs cursor
      Return the character at the current cursor position CURSOR in the
      character set CS.  It is an error to pass a cursor for which
      `end-of-char-set?' returns true.
 
  -- Scheme Procedure: char-set-cursor-next cs cursor
      Advance the character set cursor CURSOR to the next character in
      the character set CS.  It is an error if the cursor given
      satisfies `end-of-char-set?'.
 
  -- Scheme Procedure: end-of-char-set? cursor
      Return `#t' if CURSOR has reached the end of a character set, `#f'
      otherwise.
 
  -- Scheme Procedure: char-set-fold kons knil cs
      Fold the procedure KONS over the character set CS, initializing it
      with KNIL.
 
  -- Scheme Procedure: char-set-unfold p f g seed [base_cs]
  -- Scheme Procedure: char-set-unfold! p f g seed base_cs
      This is a fundamental constructor for character sets.
         * 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 the seed values.
 
         * F maps each seed value to a character. These characters are
           added to the base character set BASE_CS to form the result;
           BASE_CS defaults to the empty set.
 
      `char-set-unfold!' is the side-effecting variant.
 
  -- Scheme Procedure: char-set-for-each proc cs
      Apply PROC to every character in the character set CS.  The return
      value is not specified.
 
  -- Scheme Procedure: char-set-map proc cs
      Map the procedure PROC over every character in CS.  PROC must be a
      character -> character procedure.
 
Info Catalog (guile.info.gz) SRFI-14 Predicates/Comparison (guile.info.gz) SRFI-14 (guile.info.gz) SRFI-14 Creating Character Sets
automatically generated byinfo2html