Welcome to the CHICKEN Scheme pasting service

buffering a line from input-stream added by klm` on Sat Feb 18 19:07:54 2012


(define (make-line-peeker i)
  (let [(q '())]
    (lambda ()
      (let loop ()
        (if (char-ready? i)
         (let [(ch (read-char i))]
           (if (eq? ch #\newline)
               (let [(ret q)]
                 (set! q '())
                 (reverse-list->string ret))
               (begin
                 (set! q (cons ch q))
                 (loop) ) )))) )))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the procedure that returns the cdr of a car?
Visually impaired? Let me spell it for you (wav file) download WAV