emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Struct defined by cl-defstruct with :noinline failed to set slot using s


From: Zhu Zihao
Subject: Struct defined by cl-defstruct with :noinline failed to set slot using setf
Date: Mon, 2 Sep 2019 13:03:31 +0800 (CST)

Consider following code at dd162a3f226

(cl-defstruct (a (:noinline t)) b c)

(let ((a (make-a :b 1 :c 2)))
  (setf (a-b a) 1))


Get an error "Symbol’s function definition is void: \(setf\ a-b\)".

IMO, the problem is when :noinline was given, cl-defstruct will use defun
instead of cl-defsubst to create getter, which can't be handled by "setf"'s form
expansion automatically. If we want to allow user to modify slots of a struct
defined with :noinline argument, we should define the setters manually.

--

Zihao


 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]