X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcross-io.lisp;h=012125680fe0eb368c207a29a46ccaf62ec133ef;hb=d720bc359f03734ccb9baf66cb45dc01d623f369;hp=2714eafd6992413c1a36c1e9209b3fb9a8fae0bf;hpb=cea4896b2482b7b2b429c1631d774b4cfbc0efba;p=sbcl.git diff --git a/src/code/cross-io.lisp b/src/code/cross-io.lisp index 2714eaf..0121256 100644 --- a/src/code/cross-io.lisp +++ b/src/code/cross-io.lisp @@ -9,7 +9,7 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB!IMPL") +(in-package "SB!FASL") ;;;; fast-read operations ;;;; @@ -18,13 +18,15 @@ ;;;; implementations, and the ordinary fop implementations are defined in terms ;;;; of fast-read operations.) -(defmacro prepare-for-fast-read-byte (stream &body forms) - `(let ((%frc-stream% ,stream)) - ,@forms)) - -(defmacro fast-read-byte (&optional (eof-error-p t) (eof-value nil) any-type) - (declare (ignore any-type)) - `(read-byte %frc-stream% ,eof-error-p ,eof-value)) - -(defmacro done-with-fast-read-byte () - `(values)) +(defmacro with-fast-read-byte ((type stream &optional (eof-error-p t) eof-value) + &body body) + (declare (ignore type)) + (let ((f-stream (gensym "STREAM")) + (f-eof-error-p (gensym "EOF-ERROR-P")) + (f-eof-value (gensym "EOF-VALUE"))) + `(let ((,f-stream ,stream) + (,f-eof-error-p ,eof-error-p) + (,f-eof-value ,eof-value)) + (flet ((fast-read-byte () + (the ,type (read-byte ,f-stream ,f-eof-error-p ,f-eof-value)))) + ,@body))))