chickadee » srfi-135 » text-accumulator

text-accumulatorprocedure

Returns an accumulator that, when invoked on a character, appends that character to an (initially empty) internal text and returns an unspecified value. Invoking the accumulator on an eof-object instead returns the accumulated text.

Example:

(let ((acc (text-accumulator)))
  (acc #\a)
  (acc #\b)
  (acc #\c)
  (acc #!eof))
  ⇒ «abc»