GNU bug report logs - #37283
27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf

Previous Next

Package: emacs;

Reported by: Zhu Zihao <all_but_last <at> 163.com>

Date: Mon, 2 Sep 2019 15:28:02 UTC

Severity: normal

Found in version 27.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37283 in the body.
You can then email your comments to 37283 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#37283; Package emacs. (Mon, 02 Sep 2019 15:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zhu Zihao <all_but_last <at> 163.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 02 Sep 2019 15:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zhu Zihao <all_but_last <at> 163.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50;
 Struct defined by cl-defstruct with :noinline failed to set slot
 using setf
Date: Mon, 02 Sep 2019 21:09:31 +0800
Start Emacs with "emacs -Q" and run following code

(require 'cl-lib)
(cl-defstruct (stt (:noinline t))
  slt-a slt-b)

(let ((inst (make-stt :slt-a 1 :slt-b 2)))
  (setf (stt-slt-a inst) 2))

Will get error "Symbol’s function definition is void: \(setf\ stt-slt-a\)"

It seems that the accessors of struct defined with :noinline can't be expand
with "setf" directly.

This issue probably introduced at commit 144b2243b7cee4adbc3217d871c575921f95af54.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37283; Package emacs. (Sun, 08 Sep 2019 22:44:02 GMT) Full text and rfc822 format available.

Message #8 received at 37283 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Zhu Zihao <all_but_last <at> 163.com>
Cc: 37283 <at> debbugs.gnu.org
Subject: Re: bug#37283: 27.0.50; Struct defined by cl-defstruct with
 :noinline failed to set slot using setf
Date: Sun, 08 Sep 2019 18:43:15 -0400
> (require 'cl-lib)
> (cl-defstruct (stt (:noinline t))
>   slt-a slt-b)
>
> (let ((inst (make-stt :slt-a 1 :slt-b 2)))
>   (setf (stt-slt-a inst) 2))
>
> Will get error "Symbol’s function definition is void: \(setf\ stt-slt-a\)"

I just push a patch to `master` which should fix this problem.
Can you confirm it fixes it on your side as well?


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37283; Package emacs. (Mon, 09 Sep 2019 14:38:02 GMT) Full text and rfc822 format available.

Message #11 received at 37283 <at> debbugs.gnu.org (full text, mbox):

From: Zhu Zihao <all_but_last <at> 163.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 37283 <at> debbugs.gnu.org, Zhu Zihao <all_but_last <at> 163.com>
Subject: Re: bug#37283: 27.0.50;
 Struct defined by cl-defstruct with :noinline failed to set slot
 using setf
Date: Mon, 09 Sep 2019 21:26:38 +0800
On Mon, 09 Sep 2019 06:43:15 +0800,
Stefan Monnier wrote:
> 
> > (require 'cl-lib)
> > (cl-defstruct (stt (:noinline t))
> >   slt-a slt-b)
> >
> > (let ((inst (make-stt :slt-a 1 :slt-b 2)))
> >   (setf (stt-slt-a inst) 2))
> >
> > Will get error "Symbol’s function definition is void: \(setf\ stt-slt-a\)"
> 
> I just push a patch to `master` which should fix this problem.
> Can you confirm it fixes it on your side as well?
> 
> 
>         Stefan

Yes, this snippet work as expected now. Thanks for your work.





Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Mon, 09 Sep 2019 21:35:01 GMT) Full text and rfc822 format available.

Notification sent to Zhu Zihao <all_but_last <at> 163.com>:
bug acknowledged by developer. (Mon, 09 Sep 2019 21:35:02 GMT) Full text and rfc822 format available.

Message #16 received at 37283-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 37283-done <at> debbugs.gnu.org
Subject: Re: bug#37283: 27.0.50; Struct defined by cl-defstruct with
 :noinline failed to set slot using setf
Date: Mon, 09 Sep 2019 17:34:38 -0400
> Yes, this snippet work as expected now. Thanks for your work.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 08 Oct 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 201 days ago.

Previous Next


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