GNU bug report logs -
#19620
25.0.50; Eieio constructor behaviour changed and broke pcache.el
Previous Next
Reported by: Kirill Ignatiev <kirill.ignatiev <at> gmail.com>
Date: Sat, 17 Jan 2015 04:57:02 UTC
Severity: normal
Tags: fixed
Found in version 25.0.50
Fixed in version 25.1
Done: Noam Postavsky <npostavs <at> users.sourceforge.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19620 in the body.
You can then email your comments to 19620 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19620
; Package
emacs
.
(Sat, 17 Jan 2015 04:57:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Kirill Ignatiev <kirill.ignatiev <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 17 Jan 2015 04:57:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The following code (essentially taken from pcache.el) used to work
fine until recently (worked fine in 24.4 and in some recent git head),
but gives a wrong-number-of-arguments error in current git head:
(require 'eieio)
(require 'eieio-generic)
(defclass testing ()
())
(defmethod constructor :static ((x testing) newname &rest args)
(message "Constructor")
(call-next-method))
(testing "test")
I haven't really used eieio, so I can't be sure what went wrong. Emacs
used to accept this code and run this without errors, so I assume the
code is actually correct.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19620
; Package
emacs
.
(Sat, 17 Jan 2015 05:44:02 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
Kirill Ignatiev <kirill.ignatiev <at> gmail.com> writes:
> The following code (essentially taken from pcache.el) used to work
> fine until recently (worked fine in 24.4 and in some recent git head),
> but gives a wrong-number-of-arguments error in current git head:
You have to recompile all the packages compiled with 24.4 when switching
to 25.
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19620
; Package
emacs
.
(Sat, 17 Jan 2015 06:01:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 19620 <at> debbugs.gnu.org (full text, mbox):
> You have to recompile all the packages compiled with 24.4 when switching to 25.
I did recompile pcache while figuring out a reduced test case, but I
don't see how that's relevant here. I observe this change of behaviour
on this specific test case when starting emacs with -Q and using only
the eieio package, which is built-in, so it was compiled when emacs
was compiled. That pcache fails because of this is just how I found
out that there might be some problem there.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19620
; Package
emacs
.
(Sat, 17 Jan 2015 14:13:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 19620 <at> debbugs.gnu.org (full text, mbox):
> You have to recompile all the packages compiled with 24.4 when switching
> to 25.
No, you don't. If you need that it's likely a bug, so don't do it
without first reporting the bug,
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19620
; Package
emacs
.
(Sat, 17 Jan 2015 14:44:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 19620 <at> debbugs.gnu.org (full text, mbox):
> (defmethod constructor :static ((x testing) newname &rest args)
> (message "Constructor")
> (call-next-method))
Indeed, in Emacs-25, EIEIO's object names have been mostly dropped
(with some backward compatibility). In this case, the backward
compatibility was broken.
Hmm... let me see if we can try to better preserve the backward
compatibility here. OK, I installed the patch below which should help.
Note that this `newname' argument won't be provided in Emacs-25 if you
use `make-instance', so you should try and change your code to use
eieio-named objects instead, if you need your objects to have a name.
Stefan
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -276,12 +276,6 @@ and reference them using the function `class-option'."
`(defun ,name (&rest slots)
,(format "Create a new object with name NAME of class type %S."
name)
- (if (and slots
- (let ((x (car slots)))
- (or (stringp x) (null x))))
- (funcall (if eieio-backward-compatibility #'ignore #'message)
- "Obsolete name %S passed to %S constructor"
- (pop slots) ',name))
(apply #'eieio-constructor ',name slots))))))
@@ -656,7 +650,14 @@ SLOTS are the initialization slots used by `shared-initialize'.
This static method is called when an object is constructed.
It allocates the vector used to represent an EIEIO object, and then
calls `shared-initialize' on that object."
- (let* ((new-object (copy-sequence (eieio--class-default-object-cache (eieio--class-v class)))))
+ (let* ((new-object (copy-sequence (eieio--class-default-object-cache
+ (eieio--class-v class)))))
+ (if (and slots
+ (let ((x (car slots)))
+ (or (stringp x) (null x))))
+ (funcall (if eieio-backward-compatibility #'ignore #'message)
+ "Obsolete name %S passed to %S constructor"
+ (pop slots) class))
;; Call the initialize method on the new object with the slots
;; that were passed down to us.
(initialize-instance new-object slots)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19620
; Package
emacs
.
(Wed, 29 Nov 2017 02:05:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 19620 <at> debbugs.gnu.org (full text, mbox):
tags 19620 fixed
close 19620 25.1
quit
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> (defmethod constructor :static ((x testing) newname &rest args)
>> (message "Constructor")
>> (call-next-method))
>
> Indeed, in Emacs-25, EIEIO's object names have been mostly dropped
> (with some backward compatibility). In this case, the backward
> compatibility was broken.
>
> Hmm... let me see if we can try to better preserve the backward
> compatibility here. OK, I installed the patch below which should help.
Seems this was fixed in 25.1 then.
Added tag(s) fixed.
Request was from
Noam Postavsky <npostavs <at> users.sourceforge.net>
to
control <at> debbugs.gnu.org
.
(Wed, 29 Nov 2017 02:05:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 25.1, send any further explanations to
19620 <at> debbugs.gnu.org and Kirill Ignatiev <kirill.ignatiev <at> gmail.com>
Request was from
Noam Postavsky <npostavs <at> users.sourceforge.net>
to
control <at> debbugs.gnu.org
.
(Wed, 29 Nov 2017 02:05:03 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 27 Dec 2017 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 7 years and 260 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.