Change the way compiler macros are defined (They need not understand

(FUNCALL 'function-name ...), etc). Also, add a SETF-expander for
COMPILER-MACRO-FUNCTION.
This commit is contained in:
jjgarcia 2003-05-02 10:16:32 +00:00
parent 1791e09a68
commit 961559c595
2 changed files with 3 additions and 12 deletions

View file

@ -99,12 +99,6 @@ as a VARIABLE doc and can be retrieved by (documentation 'NAME 'variable)."
;;;
;;; This is a no-op unless the compiler is installed
;;;
(defun compiler-macro-function-wrapper (function)
#'(lambda (form &optional env)
(when (and (listp form) (eq (car form) 'funcall))
(pop form))
(funcall function form env)))
(defmacro define-compiler-macro (name vl &rest body)
(multiple-value-bind (expr pprint doc-string)
(sys::expand-defmacro name vl body)
@ -113,8 +107,7 @@ as a VARIABLE doc and can be retrieved by (documentation 'NAME 'variable)."
(print function)
(setq function `(si::bc-disassemble ,function)))
`(progn
(put-sysprop ',name 'sys::compiler-macro
(compiler-macro-function-wrapper ,function))
(put-sysprop ',name 'sys::compiler-macro ,function)
,@(si::expand-set-documentation name 'function doc-string)
',name))))
@ -122,10 +115,6 @@ as a VARIABLE doc and can be retrieved by (documentation 'NAME 'variable)."
(declare (ignore env))
(get-sysprop name 'sys::compiler-macro))
(defun sys::undef-compiler-macro (name)
(rem-sysprop name 'sys::compiler-macro))
;;; Each of the following macros is also defined as a special form,
;;; as required by CLtL. Some of them are used by the compiler (e.g.
;;; dolist), some not at all (e.g. defun).

View file

@ -214,6 +214,8 @@ Does not check if the third gang is a single-element list."
(defsetf sys:gfun-spec-how-ref sys:gfun-spec-how-set)
#+clos
(defsetf sys:gfun-instance sys:gfun-instance-set)
(defsetf compiler-macro-function (fname) (function)
`(sys::put-sysprop ,fname 'sys::compiler-macro ,function))
(define-setf-expander getf (&environment env place indicator &optional default)