(define-module (tk ports) #:export (port-rewind!) ) (define (port-rewind! port chars n) (receive (rw rest) (split-at! chars n) (for-each (lambda (c) (unget-char port c)) rw) rest))