GNU bug report logs -
#51068
28.0.50; eieio defclass regression in emacs 28
Previous Next
Reported by: dalanicolai <dalanicolai <at> gmail.com>
Date: Thu, 7 Oct 2021 06:33:02 UTC
Severity: normal
Tags: moreinfo
Found in version 28.0.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 51068 <at> debbugs.gnu.org (full text, mbox):
dalanicolai <dalanicolai <at> gmail.com> writes:
> Starting from emacs -Q, in Emacs 27 when I try to evaluate the following code:
>
> (require 'eieio)
>
> (defclass rectangle ()
> (height width))
>
> different than in CLOS, Emacs errors with:
> '(wrong-type-argument listp height)'
>
> When I evaluate the same code in Emacs 28 then Emacs does not return an
> error.
>
> However, if I subsequently try to initialize the slots using:
>
> (let ((r (make-instance rectangle)))
> (setf (slot-value r 'height) 2
> (slot-value r 'width) 3))
>
> then Emacs 28 does return an error. If I replace the code to create the
> class with (adding the parentheses around the slots):
>
> (defclass rectangle ()
> ((height) (width)))
>
> then the code above for initializing the slots works as expected (and similar behavior
> when using oref). Which means that also in Emacs 28 the parentheses are required.
> So Emacs 27 correctly errors when not using them, but Emacs 28 suggests that
> things are alright when omitting the parentheses which is incorrect and confusing.
>
> Then additionally, the requirement of the parentheses is, as far as I
> could find, not explicitly mentioned as a 'difference from CLOS' in the manual, which
> 'additionlly' is confusing.
(I'm going through old bug reports that unfortunately weren't resolved
at the time.)
This is still the case in Emacs 29. Erroring out earlier (like Emacs
27) sounds like a good idea, and so is documenting this.
Perhaps Stefan has some comments; added to the CCs.
This bug report was last modified 2 years and 237 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.