GNU bug report logs - #69049
29.2; Buglet in `read-from-string' (and, likely, `read') with defstructs.

Previous Next

Package: emacs;

Reported by: marco.antoniotti <at> unimib.it

Date: Sun, 11 Feb 2024 11:59:01 UTC

Severity: normal

Found in version 29.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Marco Antoniotti <marco.antoniotti <at> unimib.it>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Philip Kaludercic <philipk <at> posteo.net>, 69049 <at> debbugs.gnu.org
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 part 1 (text/plain, inline)]
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 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Cc: 69049 <at> debbugs.gnu.org
> > From: Philip Kaludercic <philipk <at> posteo.net>
> > Date: Sun, 11 Feb 2024 12:37:08 +0000
> >
> > Marco Antoniotti <marco.antoniotti <at> unimib.it> 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\")") ;=> (#s(foo :msg "baz") . 18)
>
> The doc string of read-from-string says:
>
>   read-from-string is a built-in function in ‘src/lread.c’.
>
>   (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?
>
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 178 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.