1
 2
 3
 4
 5
 6
 7
 8
 9
10
(define (comment a)
  (with-output-to-string (lambda ()
    (with-input-from-string a (lambda ()
      (let loop ((sw #t) (c (read-char)))
        (let ((loopx (cut loop <> (read-char)))
              (test-char-peek (lambda (x y) (and (char=? c x) (char=? (peek-char) y)))))
          (cond ((eof-object? c) #t)
                ((and sw (test-char-peek #\/ #\*)) (loopx #f))
                ((and (not sw) (test-char-peek #\* #\/)) (read-char) (loopx #t))
                (else (when sw (write-char c)) (loopx sw))))))))))