all messages for Emacs-related lists mirrored at yhetil.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 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.