[slime-cvs] CVS update: slime/swank-lispworks.lisp

Luke Gorrie lgorrie at common-lisp.net
Thu Jun 17 11:39:29 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv25308

Modified Files:
	swank-lispworks.lisp 
Log Message:
(with-fairly-standard-io-syntax): New macro. Like
with-standard-io-syntax, but keeps the existing values of *package*
and *readtable*.

(dspec-stream-position): Use it.

Date: Thu Jun 17 04:39:28 2004
Author: lgorrie

Index: slime/swank-lispworks.lisp
diff -u slime/swank-lispworks.lisp:1.44 slime/swank-lispworks.lisp:1.45
--- slime/swank-lispworks.lisp:1.44	Thu Jun 17 03:10:48 2004
+++ slime/swank-lispworks.lisp	Thu Jun 17 04:39:27 2004
@@ -346,9 +346,20 @@
     (null (list :position offset))
     (symbol (list :function-name (string dspec)))))
 
+(defmacro with-fairly-standard-io-syntax (&body body)
+  "Like WITH-STANDARD-IO-SYNTAX but preserve *PACKAGE* and *READTABLE*."
+  (let ((package (gensym))
+        (readtable (gensym)))
+    `(let ((,package *package*)
+           (,readtable *readtable*))
+      (with-standard-io-syntax
+        (let ((*package* ,package)
+              (*readtable* ,readtable))
+          , at body)))))
+
 #-(or lispworks-4.1 lispworks-4.2)      ; no dspec:parse-form-dspec prior to 4.3
 (defun dspec-stream-position (stream dspec)
-  (let ((*read-eval* t))
+  (with-fairly-standard-io-syntax
     (loop (let* ((pos (file-position stream))
                  (form (read stream nil '#1=#:eof)))
             (when (eq form '#1#)





More information about the slime-cvs mailing list