]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove purespace fix from cl-preloaded.el
authorStefan Kangas <stefankangas@gmail.com>
Mon, 9 Dec 2024 20:34:57 +0000 (21:34 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 3 Feb 2025 11:06:08 +0000 (12:06 +0100)
* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Remove fix for
purespace.  This effectively reverts Stefan Monnier's commit
e785c74d3a88.

(cherry picked from commit bb64e9464c584bace441f60678b80f41ddc6e2a3)

lisp/emacs-lisp/cl-preloaded.el

index 664206a37714b59045c2bfa8d00912e713ac1645..0399b1791252b5210ddfff48e1a2f761aacf9a17 100644 (file)
     (add-to-list 'current-load-list `(define-type . ,name))
     (cl--struct-register-child parent-class tag)
     (unless (or (eq named t) (eq tag name))
-      ;; 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)
+      (eval `(defconst ,tag ',class) t)
       ;; 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