Skip to content
Snippets Groups Projects
Commit bffc5489 authored by wlott's avatar wlott
Browse files

Added *read-eval*. If a #. is encountered while *read-eval* is NIL, an

error is signaled.  It defaults to T.
parent 38785da1
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sharpm.lisp,v 1.6 1991/08/22 16:01:29 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sharpm.lisp,v 1.7 1991/11/28 21:08:54 wlott Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -118,15 +118,21 @@ ...@@ -118,15 +118,21 @@
(error "Illegal terminating character after a colon.")))) (error "Illegal terminating character after a colon."))))
(T (make-symbol token))))) (T (make-symbol token)))))
;;;; #. handling.
(export '(*read-eval*))
(defvar *read-eval* t
"If false, then the #. read macro is disabled.")
(defun sharp-dot (stream ignore1 ignore2) (defun sharp-dot (stream ignore1 ignore2)
(declare (ignore ignore1 ignore2)) (declare (ignore ignore1 ignore2))
(let ((token (read stream t nil t))) (if *read-eval*
(unless *read-suppress* (eval token)))) (let ((token (read stream t nil t)))
(unless *read-suppress*
(eval token)))
(error "Attemt to read #. while *READ-EVAL* is bound to NIL.")))
(defun sharp-comma (stream ignore1 ignore2)
(declare (ignore ignore1 ignore2))
(let ((token (read stream t nil t)))
(unless *read-suppress* (eval token))))
(defun sharp-R (stream ignore radix) (defun sharp-R (stream ignore radix)
(declare (ignore ignore)) (declare (ignore ignore))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment