unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: dalanicolai <dalanicolai@gmail.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 51068@debbugs.gnu.org
Subject: bug#51068: 28.0.50; eieio defclass regression in emacs 28
Date: Mon, 12 Sep 2022 13:02:03 +0200	[thread overview]
Message-ID: <87wna897pw.fsf@gnus.org> (raw)
In-Reply-To: <CACJP=3m8AjyqN-8YwtV9qxRArbb6OZpH6Onu5+0BiQ0YaRACKw@mail.gmail.com> (dalanicolai@gmail.com's message of "Thu, 7 Oct 2021 08:31:42 +0200")

dalanicolai <dalanicolai@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.





  parent reply	other threads:[~2022-09-12 11:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07  6:31 bug#51068: 28.0.50; eieio defclass regression in emacs 28 dalanicolai
2021-10-07  6:33 ` dalanicolai
2022-09-12 11:02 ` Lars Ingebrigtsen [this message]
2022-09-23 21:43   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-24 10:31     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wna897pw.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=51068@debbugs.gnu.org \
    --cc=dalanicolai@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).