; exercise 1-9

(define (copy)
  (let loop ((c (read-char)) (prev #\p))
    (cond ((eof-object? c))
          ((and (char=? #\space c) (char=? #\space prev))
            (loop (read-char) c))
          (else (display c) (loop (read-char) c)))))

(copy)