From 0b5cfe05ac6330153f797507fca86e76d29407f7 Mon Sep 17 00:00:00 2001 From: dtc <dtc> Date: Tue, 28 Jul 1998 06:56:32 +0000 Subject: [PATCH] Slight tuning of the with-in-stream and with-out-stream macros to avoid a redundant lisp-stream test. --- code/sysmacs.lisp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/code/sysmacs.lisp b/code/sysmacs.lisp index eda733fd6..184af917b 100644 --- a/code/sysmacs.lisp +++ b/code/sysmacs.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sysmacs.lisp,v 1.22 1998/07/16 13:30:52 pw Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sysmacs.lisp,v 1.23 1998/07/28 06:56:32 dtc Exp $") ;;; ;;; ********************************************************************** ;;; @@ -113,19 +113,24 @@ ;;; (defmacro with-in-stream (stream (slot &rest args) &optional stream-dispatch) `(let ((stream (in-synonym-of ,stream))) - (if (lisp-stream-p stream) - (funcall (,slot stream) stream ,@args) - ,@(when stream-dispatch - `(,(destructuring-bind (function &rest args) stream-dispatch - `(,function stream ,@args))))))) + ,(if stream-dispatch + `(if (lisp-stream-p stream) + (funcall (,slot stream) stream ,@args) + ,@(when stream-dispatch + `(,(destructuring-bind (function &rest args) stream-dispatch + `(,function stream ,@args))))) + `(funcall (,slot stream) stream ,@args)))) + (defmacro with-out-stream (stream (slot &rest args) &optional stream-dispatch) `(let ((stream (out-synonym-of ,stream))) - (if (lisp-stream-p stream) - (funcall (,slot stream) stream ,@args) - ,@(when stream-dispatch - `(,(destructuring-bind (function &rest args) stream-dispatch - `(,function stream ,@args))))))) + ,(if stream-dispatch + `(if (lisp-stream-p stream) + (funcall (,slot stream) stream ,@args) + ,@(when stream-dispatch + `(,(destructuring-bind (function &rest args) stream-dispatch + `(,function stream ,@args))))) + `(funcall (,slot stream) stream ,@args)))) ;;;; These are hacks to make the reader win. -- GitLab