File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -62,3 +62,25 @@ inversion of gas-comment-region"
62
62
(delete-char 1 ))
63
63
(next-line ))
64
64
(goto-char end)))
65
+
66
+ (defun cl-struct-define (name docstring parent type named slots children-sym
67
+ tag print-auto )
68
+ (cl-assert (or type (equal '(cl-tag-slot) (car slots))))
69
+ (cl-assert (or type (not named)))
70
+ (if (boundp children-sym)
71
+ (add-to-list children-sym tag)
72
+ (set children-sym (list tag)))
73
+ (let* ((parent-class parent))
74
+ (while parent-class
75
+ (add-to-list (intern (format " cl-struct-%s -tags " parent-class)) tag)
76
+ (setq parent-class (get parent-class 'cl-struct-include ))))
77
+ ; ; If the cl-generic support, we need to be able to check
78
+ ; ; if a vector is a cl-struct object, without knowing its particular type.
79
+ ; ; So we use the (otherwise) unused function slots of the tag symbol
80
+ ; ; to put a special witness value, to make the check easy and reliable.
81
+ (unless named (fset tag :quick-object-witness-check ))
82
+ (put name 'cl-struct-slots slots)
83
+ (put name 'cl-struct-type (list type named))
84
+ (if parent (put name 'cl-struct-include parent))
85
+ (if print-auto (put name 'cl-struct-print print-auto))
86
+ (if docstring (put name 'structure-documentation docstring)))
You can’t perform that action at this time.
0 commit comments