You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
(define-module (tk ports)
|
|
#:export (port-rewind!)
|
|
)
|
|
|
|
;; Rewinds n chars back into port. Useful when parsing a character stack.
|
|
(define (port-rewind! port chars n)
|
|
(receive (rw rest) (split-at! chars n)
|
|
(for-each (lambda (c) (unget-char port c)) rw) rest))
|