mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-09 06:30:32 -07:00
with-clean-symbols moved to cmuutil.lsp and used in iolib.lsp
This commit is contained in:
parent
3abdab1bbb
commit
61e4cdb065
3 changed files with 18 additions and 13 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue