-
- Downloads
"README.md" did not exist on "5ed197dbe7dabf2e4d734f938ef85157a8379b08"
(in-package :cl-user)
(require :gray-streams) (defclass my-in-stream (ext:fundamental-character-input-stream) ((last-char :initarg :last-char))) (let ((string " a ") (i 0)) (defmethod ext:stream-read-char ((s my-in-stream)) (with-input-from-string (s "b") (read s)) (with-slots (last-char) s (cond (last-char (prog1 last-char (setf last-char nil))) (t (prog1 (aref string i) (setq i (mod (1+ i) (length string))))))))) (defmethod ext:stream-unread-char ((s my-in-stream) char) (setf (slot-value s 'last-char) char) nil) (setq x (make-instance 'my-in-stream :last-char nil)) (read x) => b, instead of a * src/code/reader.lisp: Use a new read buffer for each call to read or read-preserving-whitespace, instead of using one global buffer. From Helmut Eller.
Loading
Please register or sign in to comment