with-clean-symbols moved to cmuutil.lsp and used in iolib.lsp

parent 3abdab1b
......@@ -7,6 +7,7 @@
(in-package "COMPILER")
#-new-cmp
(import 'sys::arglist "COMPILER")
(import 'sys::with-clean-symbols "COMPILER")
#+new-cmp
(in-package "C-DATA")
......@@ -84,13 +85,6 @@
(incf *env*)
(setq *max-env* (max *env* *max-env*))))
(defmacro with-clean-symbols (symbols &body body)
"Rewrites the given forms replacing the given symbols with uninterned
ones, which is useful for creating hygienic macros."
`(progn ,@(sublis (loop for s in symbols
collect (cons s (make-symbol (symbol-name s))))
body)))
(defmacro reckless (&rest body)
`(locally (declare (optimize (safety 0)))
,@body))
......@@ -146,3 +146,10 @@
`(,symbol (gensym ,stem))))
symbols)
,@body))
(defmacro with-clean-symbols (symbols &body body)
"Rewrites the given forms replacing the given symbols with uninterned
ones, which is useful for creating hygienic macros."
`(progn ,@(sublis (mapcar #'(lambda (s) (cons s (make-symbol (symbol-name s))))
symbols)
body)))
......@@ -245,17 +245,21 @@ is not given, ends the recording."
The forms of the body are executed in a print environment that corresponds to
the one defined in the ANSI standard. *print-base* is 10, *print-array* is t,
*package* is \"CL-USER\", etc."
`(progv (car +io-syntax-progv-list+)
(cdr +io-syntax-progv-list+)
,@body))
(with-clean-symbols (%progv-list)
`(let ((%progv-list +io-syntax-progv-list+))
(progv (car (ext:truly-the cons %progv-list))
(cdr (ext:truly-the cons %progv-list))
,@body))))
(defmacro with-ecl-io-syntax (&body body)
"Syntax: ({forms}*)
The forms of the body are executed in a print environment that corresponds to
the one used internally by ECL compiled files."
`(progv (car +ecl-syntax-progv-list+)
(cdr +ecl-syntax-progv-list+)
,@body))
(with-clean-symbols (%progv-list)
`(let ((%progv-list +ecl-syntax-progv-list+))
(progv (car (ext:truly-the cons %progv-list))
(cdr (ext:truly-the cons %progv-list))
,@body))))
#-formatter
(defmacro formatter (control-string)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment