From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#49291: [akater] [PATCH] lisp/emacs-lisp/eieio.el (initialize-instance): Fix initform Date: Fri, 09 Jul 2021 11:00:27 -0400 Message-ID: References: <875yxvuwtf.fsf@gmail.com> <8735sxmac9.fsf@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38806"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 49291@debbugs.gnu.org To: akater Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 09 17:01:36 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1s0W-0009u1-Bl for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Jul 2021 17:01:36 +0200 Original-Received: from localhost ([::1]:43518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1s0V-0006o6-6x for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Jul 2021 11:01:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1s00-0006mn-Cw for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2021 11:01:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1rzy-0002Bj-Uo for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2021 11:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m1rzy-0000AU-Au for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2021 11:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Jul 2021 15:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49291 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49291-submit@debbugs.gnu.org id=B49291.1625842838610 (code B ref 49291); Fri, 09 Jul 2021 15:01:02 +0000 Original-Received: (at 49291) by debbugs.gnu.org; 9 Jul 2021 15:00:38 +0000 Original-Received: from localhost ([127.0.0.1]:59504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1rza-00009m-C5 for submit@debbugs.gnu.org; Fri, 09 Jul 2021 11:00:38 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1rzX-00009Y-Vk for 49291@debbugs.gnu.org; Fri, 09 Jul 2021 11:00:37 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id ED1B5440C76; Fri, 9 Jul 2021 11:00:29 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 93E884403A2; Fri, 9 Jul 2021 11:00:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1625842828; bh=BqTIh+go+U8dF/xVoiT/E5d4coRuWmgFrkih1rTvU4c=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=TvpaC2hmKV4EQYUQgd5LB/7GRZ/P/a+DSquLVBFvBvTIjGedM6PLHvTs63nc+MSvl iQkXzY37733ieCu/CtjgsSTo5ZXTVeUYJCawfpzNL4ag6jj2y/0Kjp75JZHIoKCzkK bEapgrP6FFRbL4co2PdU/wva662+lrw58fTI2bgLec0GcOcbqEio6WpdqxiFJ8XsUt ZGoFYM/B6Aj0yoLxIclHrERJtfckA5IxqySITCudy3t1TK7gCsaSUdlP9dISg33aXd bpioZFcr/AyZo5SQe91EkMCzab2dm1OxRF61dB4z8pngX3yXS4l5feZINlG8YLSKcg K7iWHtIl3mrsw== Original-Received: from alfajor (unknown [216.154.29.138]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 48E56120328; Fri, 9 Jul 2021 11:00:28 -0400 (EDT) In-Reply-To: <8735sxmac9.fsf@gmail.com> (akater's message of "Fri, 02 Jul 2021 07:41:26 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209725 Archived-At: akater [2021-07-02 07:41:26] wrote: > A version with correct code generation. Tests pass on 27. Sorry 'bout the delay. > Replace :initform (symbol-value 'x) to :initform x everywhere. This can't be right because it presumes the CLOS semantics which we don't have yet: `:initform x` will use the symbol `x` rather than the value of variable `x` as the default value (and it will emit a warning because we don't want code to rely on this non-CLOS-compatible semantics). Hopefully we'll be able to do that in a few years, but we're not there yet. > +(defclass eieio-tests-initargs-initform-interplay () > + ((slot-with-initarg-and-initform > + :initarg :slot-with-initarg-and-initform > + :initform 'value-specified-in-defclass-form) > + (slot-with-initarg-only > + :initarg :slot-with-initarg-only) > + (slot-with-initform-only > + :initform 'value-specified-in-defclass-form))) I don't understand how you can use this to test the interplay between :initargs and :initform. I thought this bug was about the fact that :iniform gets evaluated in cases where it shouldn't, not about the final value in the object. IOW it's about potential side-effects of evaluating :initform in cases where we shouldn't. But the above :initforms are all pure so I can't see how it can test what we're after. More to the point: the `eieio-test-25-slot-tests` extended as in your patch passes successfully without your changes to eieio.el, so it's not a proper regression test: we want a test that fails on the current code and succeeds after we install your patch. Another thing, in the patch you have: +(eval-when-compile (require 'cl-macs)) which is not only redundant with the (eval-when-compile (require 'cl-lib)) on the previous line, but makes assumptions about the way cl-lib is split into files: always require `cl-lib` (rather than `cl-macs`, `cl-extra`, etc...) when you need any part of it. Stefan