From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Marco Antoniotti Newsgroups: gmane.emacs.bugs Subject: bug#69049: 29.2; Buglet in `read-from-string' (and, likely, `read') with defstructs. Date: Sun, 11 Feb 2024 14:31:55 +0100 Message-ID: References: <275DF690-3547-4CF3-B711-0498EB1746A9@unimib.it> <874jefyy6j.fsf@posteo.net> <86mss7rv1h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f535a506111b2f7e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="617"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , 69049@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 11 14:33:14 2024 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 1rZ9xJ-000AW1-Os for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Feb 2024 14:33:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZ9wv-000718-KD; Sun, 11 Feb 2024 08:32:49 -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 1rZ9ws-00070A-LM for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 08:32:48 -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 1rZ9ws-0000wU-BM for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 08:32:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rZ9x8-00078S-HC for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 08:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Marco Antoniotti Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2024 13:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69049 X-GNU-PR-Package: emacs Original-Received: via spool by 69049-submit@debbugs.gnu.org id=B69049.170765835127360 (code B ref 69049); Sun, 11 Feb 2024 13:33:02 +0000 Original-Received: (at 69049) by debbugs.gnu.org; 11 Feb 2024 13:32:31 +0000 Original-Received: from localhost ([127.0.0.1]:47465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZ9wd-00077D-3k for submit@debbugs.gnu.org; Sun, 11 Feb 2024 08:32:31 -0500 Original-Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]:50440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZ9wa-00076p-Vl for 69049@debbugs.gnu.org; Sun, 11 Feb 2024 08:32:29 -0500 Original-Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2d09faadba5so30941031fa.1 for <69049@debbugs.gnu.org>; Sun, 11 Feb 2024 05:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unimib.it; s=google; t=1707658327; x=1708263127; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=eHeGkL4sxaOa5iricHU1MUYY7s7QMgxwmEMP5gbhwkg=; b=C09iw5j+427BQCghdZobG3Kq9d3SMg7lYHTl2HVxsand8sEkdHo4mDKO/PDwfodC3e C6Ct6FBxu88EWgPRdNU0jydMLI1vdZ1/NigSOqkgpwPppi/LqqF2aXuewhq7r8MEeBH5 FEiqqk1JFu056UHEFvS1/ncogn6/8+781ZsRgimuGFEeBoSpuNwi7x24eFsdcWfkES8/ OxG20jo9aCW+UZJhj86S1jVqkf/oRH1/N8FyVuciHFJqCeKUJASyJy/J7BOIqSQNZoqZ skhumolvn3BsquHt0GifMZYk5sCL1HTNEzvMxVTgvEnHZ7sK7YXIljpsOw/UcnuWE56Y C7UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707658327; x=1708263127; h=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=eHeGkL4sxaOa5iricHU1MUYY7s7QMgxwmEMP5gbhwkg=; b=hbWiXZOrKdfP/eanBceLCbX2G+QqTHIGHS66uT3Z4f2aARp43jMEIsA1Q48aKFRHHU xR7RbRpiHRZNQJdwO0Zq6mRM/erioYNYnip6KqHnQJXbPaQfKMEwLwN0KE9WCdwls/gS cYjaeuKJq6X8HFKudtqS5dtZkeVmthlnDVet8nvFaOCdNReRHQRsBCZbfbC4UgdnSomZ ix9G8hAQnzjku5knjaXo/xpxFQ4FiyfYd6zInpFXt5stN5LWkWt/2ZT0UhMXhzgaqXFG PLwm/fzLNK5Cq5odAFiqjQG4osejQgSG+9/2YuIRgg8VNcwBKAnlP9pDqmaOG5/7Sk61 2LCg== X-Gm-Message-State: AOJu0YxYk5HVddAiQrqw8gGjY7rPfFWcR5/ZuE5hnSqVdnlPa6qmX9SX EkLBc7iB02zfgxL+94sVWfwThBaq5JZY2IosxCt2/exnaS4ueYbUnQvzVfj4iPO88aUzXpd4Q+I s5FDiWxMj/6wlCP7MsS2L8hruY0CeRe8n30cBFQ== X-Google-Smtp-Source: AGHT+IHd7+0griDY9HMlldq9gxSDfrZhk8735pBjSTcQ6CDmk+8tAH3o4UNKuS28NY4mNlUMbV3pjOcWw7lUz8jGERk= X-Received: by 2002:a2e:9d91:0:b0:2d0:d609:df with SMTP id c17-20020a2e9d91000000b002d0d60900dfmr2596432ljj.26.1707658326646; Sun, 11 Feb 2024 05:32:06 -0800 (PST) In-Reply-To: <86mss7rv1h.fsf@gnu.org> 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:279841 Archived-At: --000000000000f535a506111b2f7e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It looks like the buglet is fixed in 30.x. It is still there in 29.2. Eli, the slot value is set incorrectly in the structure returned (in 29.2). MA On Sun, Feb 11, 2024 at 2:26=E2=80=AFPM Eli Zaretskii wrote: > > Cc: 69049@debbugs.gnu.org > > From: Philip Kaludercic > > Date: Sun, 11 Feb 2024 12:37:08 +0000 > > > > Marco Antoniotti writes: > > > > > Hi > > > > > > Here is the problem. This is in IELM. > > > > > > ELISP> (cl-defstruct foo (msg "bar")) > > > foo > > > ELISP> (make-foo) > > > #s(foo :msg "bar") > > > > > > ELISP> (make-foo :msg "baz") > > > #s(foo :msg "baz") > > > > > > ELISP> (read-from-string "#s(foo :msg \"baz\")") > > > (#s(foo :msg :msg) > > > . 18) > > > > FWIW on Emacs 30.0.50 I get > > > > (read-from-string "#s(foo :msg \"baz\")") ;=3D> (#s(foo :msg "baz") . 1= 8) > > The doc string of read-from-string says: > > read-from-string is a built-in function in =E2=80=98src/lread.c=E2=80= =99. > > (read-from-string STRING &optional START END) > > Read one Lisp expression which is represented as text by STRING. > Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). > FINAL-STRING-INDEX is an integer giving the position of the next > remaining character in STRING. > > So it looks like read-from-string is working as advertised here? > --000000000000f535a506111b2f7e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It looks like the buglet is fixed in 30.x.=C2=A0 It i= s still there in 29.2.

Eli, the slot value is set incorre= ctly in the structure returned (in 29.2).

MA

On Sun, Feb 11, 2024 at 2:26=E2=80=AFPM Eli Zaretskii <eliz@gnu.org> wrote:
> Cc: 69049@debbugs.gnu.org
> From: Philip Kaludercic <philipk@posteo.net>
> Date: Sun, 11 Feb 2024 12:37:08 +0000
>
> Marco Antoniotti <marco.antoniotti@unimib.it> writes:
>
> > Hi
> >
> > Here is the problem.=C2=A0 This is in IELM.
> >
> > ELISP> (cl-defstruct foo (msg "bar"))
> > foo
> > ELISP> (make-foo)
> > #s(foo :msg "bar")
> >
> > ELISP> (make-foo :msg "baz")
> > #s(foo :msg "baz")
> >
> > ELISP> (read-from-string "#s(foo :msg \"baz\")&= quot;)
> > (#s(foo :msg :msg)
> >=C2=A0 =C2=A0 . 18)
>
> FWIW on Emacs 30.0.50 I get
>
> (read-from-string "#s(foo :msg \"baz\")") ;=3D>= (#s(foo :msg "baz") . 18)

The doc string of read-from-string says:

=C2=A0 read-from-string is a built-in function in =E2=80=98src/lread.c=E2= =80=99.

=C2=A0 (read-from-string STRING &optional START END)

=C2=A0 Read one Lisp expression which is represented as text by STRING.
=C2=A0 Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX).
=C2=A0 FINAL-STRING-INDEX is an integer giving the position of the next
=C2=A0 remaining character in STRING.

So it looks like read-from-string is working as advertised here?
--000000000000f535a506111b2f7e--