string->list

Name

string->list -- Converts a string into a list of characters.

Synopsis

(string->list str)

Description

Implements string->list as per ISO/IEC 10179:1996 (clause 8.5.9.9).

Author

David Megginson, <dmeggins@uottawa.ca>

Source Code

(define (string->list str)
  ;; Converts a string into a list of characters.
  (let loop ((chars '())
	     (k (- (string-length str) 1)))
    (if (< k 0)
	chars
	(loop (cons (string-ref str k) chars) (- k 1)))))