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:
parent
e59feb3c15
commit
6bf61df8ab
5 changed files with 27 additions and 15 deletions
|
|
@ -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".
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue