bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69049: 29.2; Buglet in `read-from-string' (and, likely, `read') with


From: Marco Antoniotti
Subject: bug#69049: 29.2; Buglet in `read-from-string' (and, likely, `read') with defstructs.
Date: Sun, 11 Feb 2024 14:31:55 +0100

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]