utility for accessing attrs
This commit is contained in:
parent
91f4a2bd9f
commit
77521e12c7
1 changed files with 16 additions and 9 deletions
|
@ -5,7 +5,8 @@
|
||||||
:alist
|
:alist
|
||||||
:alistp
|
:alistp
|
||||||
:hash-alist
|
:hash-alist
|
||||||
:alist-plist)
|
:aget
|
||||||
|
:delete-from-alistf)
|
||||||
(:import-from :let-over-lambda
|
(:import-from :let-over-lambda
|
||||||
:defmacro!
|
:defmacro!
|
||||||
:mkstr
|
:mkstr
|
||||||
|
@ -58,17 +59,23 @@
|
||||||
|
|
||||||
(defstruct attrs alist)
|
(defstruct attrs alist)
|
||||||
|
|
||||||
;;; TODO make it setf
|
(defmethod (setf attr) (value (attrs attrs) key)
|
||||||
(defmethod set-attr ((attrs attrs) key value)
|
(setf (aget (attrs-alist) key) value))
|
||||||
)
|
|
||||||
|
|
||||||
(defmethod delete-attr ((attrs attrs) key value)
|
(defmethod delete-attr ((attrs attrs) key)
|
||||||
)
|
(delete-from-alistf (attrs-alist attrs) key))
|
||||||
|
|
||||||
(defmethod get-attr ((attrs attrs))
|
(defmethod attr ((attrs attrs) key)
|
||||||
)
|
(aget (attrs-alist attrs) key))
|
||||||
|
|
||||||
; (defmethod set-attr ((element element) key value))
|
(defmethod (setf attr) (value (element element) key)
|
||||||
|
(setf (attr (element-attrs element) key) value))
|
||||||
|
|
||||||
|
(defmethod delete-attr ((element element) key)
|
||||||
|
(delete-attr (element-attrs element) key))
|
||||||
|
|
||||||
|
(defmethod attr ((element element) key)
|
||||||
|
(attr (element-attrs element)))
|
||||||
|
|
||||||
(defun split-attrs-and-children (attrs-and-children)
|
(defun split-attrs-and-children (attrs-and-children)
|
||||||
(cond
|
(cond
|
||||||
|
|
Loading…
Reference in a new issue