diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2017-02-21 13:48:30 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2017-02-21 13:48:30 -0500 |
commit | e785c74d3a8860e11474cd645179b32ab16e91b8 (patch) | |
tree | 90847604ee05b78733d9d90042a004218fc62037 /lisp/emacs-lisp | |
parent | 20dda6be76236253f689037a31dcc82cc9673bd4 (diff) | |
download | emacs-e785c74d3a8860e11474cd645179b32ab16e91b8.tar.gz emacs-e785c74d3a8860e11474cd645179b32ab16e91b8.tar.bz2 emacs-e785c74d3a8860e11474cd645179b32ab16e91b8.zip |
* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Fix duplication
which resulted in incomplete list of parents in one copy of the
cl-structure-class class.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-preloaded.el | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el index 0b079410002..bba7b83a792 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el @@ -151,7 +151,20 @@ (add-to-list 'current-load-list `(define-type . ,name)) (cl--struct-register-child parent-class tag) (unless (eq named t) - (eval `(defconst ,tag ',class) t) + ;; We used to use `defconst' instead of `set' but that + ;; has a side-effect of purecopying during the dump, so that the + ;; class object stored in the tag ends up being a *copy* of the + ;; one stored in the `cl--class' property! We could have fixed + ;; this needless duplication by using the purecopied object, but + ;; that then breaks down a bit later when we modify the + ;; cl-structure-class class object to close the recursion + ;; between cl-structure-object and cl-structure-class (because + ;; modifying purecopied objects is not allowed. Since this is + ;; done during dumping, we could relax this rule and allow the + ;; modification, but it's cumbersome). + ;; So in the end, it's easier to just avoid the duplication by + ;; avoiding the use of the purespace here. + (set tag class) ;; In the cl-generic support, we need to be able to check ;; if a vector is a cl-struct object, without knowing its particular type. ;; So we use the (otherwise) unused function slots of the tag symbol |