]> git.eshelyaron.com Git - emacs.git/commit
eieio-core.el: Allow assignment to cl-structs through `slot-value`
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 4 Dec 2021 18:47:19 +0000 (13:47 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 4 Dec 2021 18:47:35 +0000 (13:47 -0500)
commitde727b5886fb4a81df2dc17d9d094e915c1e9fb4
treec7e1f3ae109eb8cc6c11abf9391b25bf8d15b8cf
parent63be97fb050545cc33ae5d857188ad45fbe27715
eieio-core.el: Allow assignment to cl-structs through `slot-value`

* lisp/emacs-lisp/eieio-core.el (eieio--validate-slot-value):
Obey the `:read-only` property of the slot.
(eieio-oset): Allow use on cl-structs as well.
(eieio-read-only): New error.

* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test--struct):
Make the last field read-only.
(eieio-test-defstruct-slot-value): Test that cl-struct slots can be
assigned via `slot-value`.
doc/misc/eieio.texi
etc/NEWS
lisp/emacs-lisp/eieio-core.el
test/lisp/emacs-lisp/eieio-tests/eieio-tests.el