]> git.eshelyaron.com Git - emacs.git/commit
Make cl-defstruct use records.
authorLars Brinkhoff <lars@nocrew.org>
Tue, 14 Mar 2017 12:52:40 +0000 (13:52 +0100)
committerLars Brinkhoff <lars@nocrew.org>
Thu, 30 Mar 2017 16:31:27 +0000 (18:31 +0200)
commit03cf46327d03ad5130052e77060dbd24ad8e9843
treebfa32cd7d69c2a3cebe866d00bbb2cbee4ad57ce
parentf98a2a1943548fbe1b54f354d25cf1fb103ca7ba
Make cl-defstruct use records.

* lisp/emacs-lisp/cl-extra.el (cl--describe-class)
(cl--describe-class-slots): Use the new `type-of'.

* lisp/emacs-lisp/cl-generic.el (cl--generic-struct-tag): Use type-of.
(cl--generic-struct-specializers): Adjust to new tag.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): When type is nil, use records.
Use the type symbol as the tag.  Use copy-record to copy structs.
(cl--defstruct-predicate): New function.
(cl--pcase-mutually-exclusive-p): Use it.
(cl-struct-sequence-type): Can now return `record'.

* lisp/emacs-lisp/cl-preloaded.el (cl--make-slot-desc): Adjust ad-hoc
code to new format.
(cl--struct-register-child): Work with records.
(cl-struct-define): Don't touch the tag's symbol-value and
symbol-function slots when we use the type as tag.

* lisp/emacs-lisp/cl-print.el (cl-print-object): Adjust to new tag.

* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-defstruct-record):
New test.

* doc/lispref/records.texi, doc/misc/cl.texi: Update for records.
doc/lispref/records.texi
doc/misc/cl.texi
lisp/emacs-lisp/cl-extra.el
lisp/emacs-lisp/cl-generic.el
lisp/emacs-lisp/cl-macs.el
lisp/emacs-lisp/cl-preloaded.el
lisp/emacs-lisp/cl-print.el
test/lisp/emacs-lisp/cl-lib-tests.el