X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcross-io.lisp;h=012125680fe0eb368c207a29a46ccaf62ec133ef;hb=48a34b34d5e82b78f51c32bf8be1dba76d3c4490;hp=98f3c7a638c4a8cd06aec58d51e02422210d759e;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/code/cross-io.lisp b/src/code/cross-io.lisp index 98f3c7a..0121256 100644 --- a/src/code/cross-io.lisp +++ b/src/code/cross-io.lisp @@ -9,10 +9,7 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB!IMPL") - -(file-comment - "$Header$") +(in-package "SB!FASL") ;;;; fast-read operations ;;;; @@ -21,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))))