mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-17 06:42:18 -08:00
GENERIC-FUNCTION-NAME is just a reader. The writer implements a different logic, acting via REINITIALIZE-INSTANCE.
This commit is contained in:
parent
645090b557
commit
93be6ce0b5
3 changed files with 7 additions and 2 deletions
|
|
@ -108,7 +108,7 @@
|
|||
(eval-when (:compile-toplevel :execute)
|
||||
(defparameter +standard-generic-function-slots+
|
||||
'((name :initarg :name :initform nil
|
||||
:accessor generic-function-name)
|
||||
:reader generic-function-name)
|
||||
(spec-list :initform nil :accessor generic-function-spec-list)
|
||||
(method-combination
|
||||
:initarg :method-combination :initform (find-method-combination (class-prototype (find-class 'standard-generic-function)) 'standard nil)
|
||||
|
|
|
|||
|
|
@ -112,6 +112,11 @@
|
|||
(setf (fdefinition name) gfun)
|
||||
gfun)))
|
||||
|
||||
(defun (setf generic-function-name) (new-name gf)
|
||||
(if *clos-booted*
|
||||
(reinitialize-instance gf :name new-name)
|
||||
(setf (slot-value gf 'name) new-name)))
|
||||
|
||||
(defun default-dispatch (generic-function)
|
||||
(cond ((null *clos-booted*)
|
||||
'standard-generic-function)
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ have disappeared."
|
|||
;;; early version used during bootstrap
|
||||
(defun add-method (gf method)
|
||||
(with-early-accessors (+standard-method-slots+ +standard-generic-function-slots+ +standard-class-slots+)
|
||||
(let* ((name (generic-function-name gf))
|
||||
(let* ((name (slot-value gf 'name))
|
||||
(method-entry (assoc name *early-methods*)))
|
||||
(unless method-entry
|
||||
(setq method-entry (list name))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue