From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#66938: 30.0.50 [PATCH]: Make EIEIO :accessor behave like :reader when reading a slot's value Date: Wed, 29 Nov 2023 14:36:15 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40751"; mail-complaints-to="usenet@ciao.gmane.io" Cc: brandon.irizarry@gmail.com, 66938@debbugs.gnu.org, 66938-done@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 29 15:37:09 2023 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 1r8LgZ-000ANi-Me for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Nov 2023 15:37:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8LgR-0000fO-Jq; Wed, 29 Nov 2023 09:37:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r8LgN-0000ec-Ox for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2023 09:36:55 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r8LgN-0003lZ-FF for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2023 09:36:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r8LgU-0002pR-SL for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2023 09:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Nov 2023 14:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66938 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66938-submit@debbugs.gnu.org id=B66938.170126860210842 (code B ref 66938); Wed, 29 Nov 2023 14:37:02 +0000 Original-Received: (at 66938) by debbugs.gnu.org; 29 Nov 2023 14:36:42 +0000 Original-Received: from localhost ([127.0.0.1]:49259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8LgA-0002om-9C for submit@debbugs.gnu.org; Wed, 29 Nov 2023 09:36:42 -0500 Original-Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:54542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8Lg8-0002oY-Nw; Wed, 29 Nov 2023 09:36:41 -0500 Original-Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-507a29c7eefso8932606e87.1; Wed, 29 Nov 2023 06:36:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701268587; x=1701873387; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aIC4DUW5s5MnF6dx0nd4IiC9BJA4rbM2FTXOs1oLq7c=; b=G5ntuHe+f/8Fy/S+GNhnuUeWBzAPUkiw3a4CE4rVB0ZgGbSlLSYVYLQ0wCpxMtP10L rZytL372fSr4frUgaQxHCXdJ2GTkTuTQNcOlJMMq46Caa21awZ2CI19nGVCOyJRn9cQu ds5dV8JAc+RQPGuF8VEDTa5MG9S6GnCk6fsspPzB1wLRkaIEbgVVF8DKirFIOAiWeiuk llPr2g0OhqxSjtfcdwIIAvr77jw/9ocEPPXo5B02FowUiDOaH/YdIeMrAU7YDMSRl4iw DKGRiaI2PxxMCb7IaNt/bbFf0FMYtNs8JAMO22hdrD8FdyHDYh3NBb3EZqUnWMbU5+Bb EDCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701268587; x=1701873387; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aIC4DUW5s5MnF6dx0nd4IiC9BJA4rbM2FTXOs1oLq7c=; b=eP2Y2WowHL3fZTcg1YcYS4Xj/AzOvnFeUZTPaFOmIY5MFG4HBX13aMlSWnDOK9bGRb yQR/tNb4eMCI07Lno+HbdVX4hYF2fcdIDs/1CPbj47/DGQPR9/PAm8+NK5rbjy4Tr/Ti 0VQLwz3xiYZXkpVro3Jh4G+KcJqMTt6Tvq+TP0tnGd7kFYNPAg4BTYHb8/MMZkjOueKw 01s0wOWy2xouJ/bEPrltE93TlWIQAERoqIinCfreQ9Bzbh2DMCo/UdoIiy0Kv9tPhB/u l9YKIJSXy3VYO+GhmfuKySpISyf1ttJteA/WV7iz9KdlkFTVO7eJW7/M9ePjjE2w7fXu Q0WQ== X-Gm-Message-State: AOJu0YycgzTs0zfEgu64OMq98AIl/+IdOysCbm4nneRIlJwxfXQHIelt zvsbph3R4eJynX2dn1tqCsb3q488hOKOqZyhoH4= X-Google-Smtp-Source: AGHT+IHsEHbcFQ2gfgZG5weiKCPdf0yBkr55giBzG9EQ6/ZOBRwYXt4oR+KrzvKaFNPoiio6qkz+ditMnoF2wxszTd0= X-Received: by 2002:ac2:430c:0:b0:50b:c26e:bfc1 with SMTP id l12-20020ac2430c000000b0050bc26ebfc1mr2014330lfh.59.1701268586971; Wed, 29 Nov 2023 06:36:26 -0800 (PST) In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275237 Archived-At: On Wed, Nov 29, 2023 at 2:01=E2=80=AFPM Stefan Monnier wrote: > > > Just wanted to say that while I think this is all very fine to > > improve on EIEIO's inaccurate emulation of CLOS, this breaks > > a lot of stuff, broke Eglot and Jsonrpc, immediately. > > > > This is mainly because EIEIO users like me got sloppy with > > their slot definitions and don't put explicit :initforms > > in them, instead relying on this quirk. > > FWIW, I don't like the `slot-boundp` business and much prefer the > principle that if an application needs such a concept it should instead > treat nil as the "unbound" marker. Of course, this 'business' is so that you can perform these lazy optimizations without a given user of a class ever noticing. You can even replace a slot by some other storage/generation mechanism completely. That's what all these (fairly expensive, granted) indirections get you. Also, as you probably guess, nil is a notoriously problematic "unbound" marker. > > Oh well, I'm fixing this now as part of bug#67480, but > > we should definitely expect flak more or less proportional > > to the use of EIEIO out there (and in here). > > Hmm... I've seen two or three issues about this already. But let's hope for the best. I support these fixes. > > BTW another reason I get sloppy is that EIEIO doesn't allow > > me to use a > > > > (some-slot :initform (error "required!") ...) > > > > like I do in CLOS. > > I think this works nowadays (the expression is not evaluated in the > right context (it's evaluated in the empty context), but AFAICT it's > evaluated at the right time): No, I think there's something off. In CLOS: ; SLY 1.0.43 (#) CL-USER> (defclass foo () ((bar :initarg :bar :initform (error "BAR is required!")))) # CL-USER> (make-instance 'foo :bar 42) # CL-USER> (make-instance 'foo) ; Debugger entered on # You can't do this in EIEIO: *** Welcome to IELM *** Type (describe-mode) or press C-h m for help. ELISP> (defclass foo () ((bar :initarg :bar :initform (error "BAR is required!")))) *** Eval error *** BAR is required! ELISP>