1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 16:20:17 -08:00

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Keep type=nil by default.

* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Add sanity checks
about relationship between `type', `named', and `slots'.
* lisp/emacs-lisp/cl-generic.el (cl--generic-struct-tagcode): Adjust to new
value of `cl-struct-type' property.
This commit is contained in:
Stefan Monnier 2015-02-16 01:37:57 -05:00
parent e59feb3c15
commit 6bf61df8ab
5 changed files with 27 additions and 15 deletions

View file

@ -731,7 +731,7 @@ Can only be used from within the lexical body of a primary or around method."
(defun cl--generic-struct-tagcode (type name)
(and (symbolp type)
(get type 'cl-struct-type)
(or (eq 'vector (car (get type 'cl-struct-type)))
(or (null (car (get type 'cl-struct-type)))
(error "Can't dispatch on cl-struct %S: type is %S"
type (car (get type 'cl-struct-type))))
(or (equal '(cl-tag-slot) (car (get type 'cl-struct-slots)))
@ -761,7 +761,7 @@ Can only be used from within the lexical body of a primary or around method."
(let ((types (list (intern (substring (symbol-name tag) 10)))))
(while (get (car types) 'cl-struct-include)
(push (get (car types) 'cl-struct-include) types))
(push 'cl-struct types) ;The "parent type" of all cl-structs.
(push 'cl-structure-object types) ;The "parent type" of all cl-structs.
(nreverse types))))
;;; Dispatch on "system types".