115
115
; (throw *cmperr-tag* '*cmperr-tag*) DEBUG
118
(defun cmp-eval (form &aux (throw-flag t))
121
(cmp-toplevel-eval form)
122
(setq throw-flag nil))
124
(let ((*print-case* :upcase))
126
(format t "~&;;; The form ~s was not evaluated successfully.~
127
~%;;; You are recommended to compile again.~%"
131
(defun cmp-macroexpand (form &aux env (throw-flag t))
132
;; Obtain the local macro environment for expansion.
134
(when (consp v) (push v env)))
135
(when env (setq env (cons nil (nreverse env))))
138
(cmp-toplevel-eval `(macroexpand ',form ',env))
139
(setq throw-flag nil))
141
(let ((*print-case* :upcase))
144
"~&;;; The macro form ~s was not expanded successfully.~
145
~%;;; You are recommended to compile again.~%"
148
(defun cmp-expand-macro (fd fname args &aux env (throw-flag t))
150
(when (consp v) (push v env)))
151
(when env (setq env (cons nil (nreverse env))))
155
`(funcall *macroexpand-hook* ',fd ',(cons fname args) ',env))
156
(setq throw-flag nil))
158
(let ((*print-case* :upcase))
161
"~&;;; The macro form (~s ...) was not expanded successfully.~
162
~%;;; You are recommended to compile again.~%"
165
(defun cmp-expand-compiler-macro (fd fname args &aux env (throw-flag t))
167
(when (consp v) (push v env)))
168
(when env (setq env (cons nil (nreverse env))))
169
(let ((form (cons fname args)))
171
(let ((new-form (cmp-toplevel-eval `(funcall *macroexpand-hook* ',fd ',form ',env))))
172
(setq throw-flag nil)
173
(values new-form (not (eql new-form form))))
175
(let ((*print-case* :upcase))
178
"~&;;; The macro form (~s ...) was not expanded successfully.~
179
~%;;; You are recommended to compile again.~%"
182
(defun cmp-toplevel-eval (form)
118
(defmacro with-cmp-protection (main-form error-form)
185
120
((sys::*ihs-base* sys::*ihs-top*)
186
121
(sys::*ihs-top* (sys::ihs-top 'cmp-toplevel-eval))
187
122
(*break-enable* *compiler-break-enable*)
188
123
(sys::*break-hidden-packages*
189
124
(cons (find-package 'compiler)
190
sys::*break-hidden-packages*)))
192
((*break-on-errors* *compiler-break-enable*))
125
sys::*break-hidden-packages*))
127
((*break-enable* *compiler-break-enable*)
130
(multiple-value-prog1 ,main-form
131
(setf throw-flag nil))
132
(when throw-flag ,error-form))))
134
(defun cmp-eval (form)
135
(with-cmp-protection (eval form)
136
(let ((*print-case* :upcase))
138
(format t "~&;;; The form ~s was not evaluated successfully.~
139
~%;;; You are recommended to compile again.~%"
142
(defun cmp-macroexpand (form &optional (env *cmp-env*))
143
(with-cmp-protection (macroexpand form env)
144
(let ((*print-case* :upcase))
146
(format t "~&;;; The macro form ~S was not expanded successfully.~
147
~%;;; You are recommended to compile again.~%" form))))
149
(defun cmp-expand-macro (fd form &optional (env *cmp-env*))
151
(let ((new-form (funcall *macroexpand-hook* fd form env)))
152
(values new-form (not (eql new-form form))))
153
(let ((*print-case* :upcase))
155
(format t "~&;;; The macro form ~S was not expanded successfully.~
156
~%;;; You are recommended to compile again.~%" form))))
195
158
(defun si::compiler-clear-compiler-properties (symbol)