Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (read-words)
- (define (iter s l)
- (let ((a (read-char)))
- (if (eof-object? a)
- (if (not (equal? s "")) (append l (list s)) l)
- (if (or (equal? a #\space) (equal? a #\newline))
- (if (equal? s "")
- (iter "" l)
- (iter "" (append l (list s))))
- (iter (string-append s (string a)) l)))))
- (iter "" '()))
Advertisement
Add Comment
Please, Sign In to add comment