GNU bug report logs -
#20914
eieio/slot/group
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
OK I got it !
The problem comes from use of `copy-sequence' in
`eieio-copy-parents-into-subclass' function of eieio-core. this
copy is not reccursive as explained in code comment but it
should be ! There's a joined patch that fixes the bug.
Regards
Pierre
[eieio-core-0629.patch (text/x-patch, inline)]
--- eieio-core..orig.el 2015-06-28 07:26:49.000000000 +0200
+++ eieio-core.el 2015-06-29 19:20:28.000000000 +0200
@@ -660,9 +660,32 @@
(let ((pslots (eieio--class-slots pcv))
(pinit (eieio--class-initarg-tuples pcv)))
(dotimes (i (length pslots))
- (let* ((sd (cl--copy-slot-descriptor (aref pslots i)))
+ ;;; -- Props should be copied as well
+ ;;; PLN Mon Jun 29 17:25:54 2015
+ ;;
+ ;; Due to the way `cl--copy-slot-descriptor' acts
+ ;; props in the copied object will not be a new
+ ;; sequence but a reference to the parent
+ ;; sequence. Hence when modifying this sequence
+ ;; parent slot props will be altered as well : and it
+ ;; SHOULD NOT !
+ ;;
+ (let* ((pslot (aref pslots i))
+ (sd (cl--copy-slot-descriptor pslot))
(init (car (rassq (cl--slot-descriptor-name sd) pinit))))
+ ;;
+ ;; Simply applying a `copy-sequence' on the props
+ ;; will not work since props itself is a sequence
+ ;; whose elements will not be copied and only
+ ;; reference elements of the old props plist. A
+ ;; reccursive copy should be performed.
+ ;;
+ (setf (cl--slot-descriptor-props sd)
+ (copy-tree
+ (cl--slot-descriptor-props pslot)))
(eieio--add-new-slot newc sd init nil nil sn))
+ ;;
+ ;;; -- End Props should be copied as well
)) ;; while/let
;; Now duplicate all the class alloc slots.
(let ((pcslots (eieio--class-class-slots pcv)))
This bug report was last modified 10 years and 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.