Skip to content

Commit

Permalink
Allow (setf setf-expander) on special operators
Browse files Browse the repository at this point in the history
See comment for explanation. Ran into this in Extrinsicl.
  • Loading branch information
Bike committed Oct 19, 2023
1 parent 38a84ca commit b113c45
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Code/default-methods.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@

(defmethod (setf env:setf-expander) (new client environment operator-name)
(case (sys:operator-status client environment operator-name)
((:function :macro)
;; CLHS says DEFINE-SETF-EXPANDER only works on function and macro names, but
;; we loosen that restriction a bit so that a setf expander can be defined for
;; THE. If an environment wants to restrict DEFINE-SETF-EXPANDER it can do so
;; just as well in the definition of DEFINE-SETF-EXPANDER, not the primitive
;; accessor here.
((:function :macro :special-operator)
(setf (sys:setf-expander client environment operator-name) new))
(otherwise
(error 'env:attempt-to-define-a-setf-expander-of-non-existing-function-or-macro
Expand Down

0 comments on commit b113c45

Please sign in to comment.