[previous] [up] [next]     [contents] [index]
Next: File Ports Up: Ports Previous: Pipes

String Ports

Scheme input and output can be read from or collected into a string:

String input and output ports do not need to be explicitly closed.

Example:

  (define i (open-input-string "hello world"))
  (define o (open-output-string))
  (write (read i) o)
  (get-output-string o) ; => "hello" 


PLT