(define (remove-comment s)
  (define (out-comment c)
    (cond ((eof-object? c))
          ((char=? c #\/)
           (cond ((eof-object? (peek-char))
                  (display c))
                 (else
                  (cond ((char=? (peek-char) #\*)
                         (read-char)
                         (in-comment (read-char)))
                        (else
                         (display c)
                         (out-comment (read-char)))))))
          (else
           (display c)
           (out-comment (read-char)))))
  (define (in-comment c)
    (cond ((eof-object? c))
          ((char=? c #\*)
           (unless (eof-object? (peek-char))
             (cond ((char=? (peek-char) #\/)
                    (read-char)
                    (out-comment (read-char)))
                   (else
                    (in-comment (read-char))))))
          (else
           (in-comment (read-char)))))
  (with-output-to-string
      (lambda ()
        (with-input-from-string s
          (lambda () (out-comment (read-char)))))))
