all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marco Antoniotti <marco.antoniotti@unimib.it>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Philip Kaludercic <philipk@posteo.net>, 69049@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	[thread overview]
Message-ID: <CAG0Nw2=21VLPOav6-+RBORzidVypp=v+h_gnM5Wk1dGYfqcXPg@mail.gmail.com> (raw)
In-Reply-To: <86mss7rv1h.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1377 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2213 bytes --]

  reply	other threads:[~2024-02-11 13:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-11 11:41 bug#69049: 29.2; Buglet in `read-from-string' (and, likely, `read') with defstructs Marco Antoniotti
2024-02-11 12:37 ` Philip Kaludercic
2024-02-11 13:26   ` Eli Zaretskii
2024-02-11 13:31     ` Marco Antoniotti [this message]
2024-02-11 14:39       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG0Nw2=21VLPOav6-+RBORzidVypp=v+h_gnM5Wk1dGYfqcXPg@mail.gmail.com' \
    --to=marco.antoniotti@unimib.it \
    --cc=69049@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.