X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-simple-streams%2Fstrategy.lisp;h=b080292694ce36555c8787b7ecd14688fb9600be;hb=1d46d379bb7a6424524b978f213ef69be5f1ad69;hp=ef74794c9c60cc06ae16e3922933ec5feba616bc;hpb=cc9a73604f696b6e69842a95b1e11f40f8cdd7bf;p=sbcl.git diff --git a/contrib/sb-simple-streams/strategy.lisp b/contrib/sb-simple-streams/strategy.lisp index ef74794..b080292 100644 --- a/contrib/sb-simple-streams/strategy.lisp +++ b/contrib/sb-simple-streams/strategy.lisp @@ -17,6 +17,7 @@ ;;;; Helper functions (defun refill-buffer (stream blocking) + (declare (type blocking blocking)) (with-stream-class (simple-stream stream) (let* ((unread (sm last-char-read-size stream)) (buffer (sm buffer stream)) @@ -140,7 +141,8 @@ (state (sm oc-state stream))) (flet ((input () (when (>= buffpos (sm buffer-ptr stream)) - (when (sc-dirty-p stream) + (when (and (not (any-stream-instance-flags stream :dual :string)) + (sc-dirty-p stream)) (flush-buffer stream t)) (let ((bytes (refill-buffer stream blocking))) (cond ((= bytes 0) @@ -216,7 +218,8 @@ (type boolean blocking) #|(optimize (speed 3) (space 2) (safety 0) (debug 0))|#) (with-stream-class (simple-stream stream) - (when (sc-dirty-p stream) + (when (and (not (any-stream-instance-flags stream :dual :string)) + (sc-dirty-p stream)) (flush-buffer stream t)) (do ((buffer (sm buffer stream)) (buffpos (sm buffpos stream)) @@ -566,10 +569,10 @@ ;;; function names), we make do with symbol frobbing. (defun %sf (kind name format &optional access) (flet ((find-strategy-function (&rest args) - (ignore-errors - (fdefinition (find-symbol (format nil "~{~A~^-~}" - (mapcar #'string args)) - #.*package*))))) + (let ((name + (find-symbol (format nil "~{~A~^-~}" (mapcar #'string args)) + #.*package*))) + (if (fboundp name) (fdefinition name) nil)))) (or (find-strategy-function kind name format access) (find-strategy-function kind name format) (find-strategy-function kind name :ef access)