GNU bug report logs -
#69049
29.2; Buglet in `read-from-string' (and, likely, `read') with defstructs.
Previous Next
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
> 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?
This bug report was last modified 1 year and 163 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.