mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-02 15:40:55 -08:00
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:
parent
1791e09a68
commit
961559c595
2 changed files with 3 additions and 12 deletions
|
|
@ -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).
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue