Welcome to the CHICKEN Scheme pasting service

copy-chars! added by crzcrz on Fri Sep 4 15:20:52 2026

(define (copy-chars! n in out)
  (let loop ((n n))
    (or (= n 0)
        (let ((p (peek-char in)))
          (and (not (eof-object? p))
               (let* ((p2 (peek-char in))
                      (c  (read-char in)))
                 (unless (and (eqv? p2 p) (eqv? c p))
                   (error "peek-char/read-char disagree"
                          chars-read p p2 c))
                 (write-char c out)
                 (set! chars-read (+ chars-read 1))
                 (loop (- n 1))))))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which module provides `define-foreign-type'?
Visually impaired? Let me spell it for you (wav file) download WAV