unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37283: 27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf
@ 2019-09-02 13:09 Zhu Zihao
  2019-09-08 22:43 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Zhu Zihao @ 2019-09-02 13:09 UTC (permalink / raw)
  To: 37283

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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#37283: 27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf
  2019-09-02 13:09 bug#37283: 27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf Zhu Zihao
@ 2019-09-08 22:43 ` Stefan Monnier
  2019-09-09 13:26   ` Zhu Zihao
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2019-09-08 22:43 UTC (permalink / raw)
  To: Zhu Zihao; +Cc: 37283

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






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#37283: 27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf
  2019-09-08 22:43 ` Stefan Monnier
@ 2019-09-09 13:26   ` Zhu Zihao
  2019-09-09 21:34     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Zhu Zihao @ 2019-09-09 13:26 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 37283, Zhu Zihao

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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#37283: 27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf
  2019-09-09 13:26   ` Zhu Zihao
@ 2019-09-09 21:34     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2019-09-09 21:34 UTC (permalink / raw)
  To: 37283-done

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






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-09 21:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-02 13:09 bug#37283: 27.0.50; Struct defined by cl-defstruct with :noinline failed to set slot using setf Zhu Zihao
2019-09-08 22:43 ` Stefan Monnier
2019-09-09 13:26   ` Zhu Zihao
2019-09-09 21:34     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).