Improve defhsx

This commit is contained in:
paku 2024-05-27 18:33:55 +09:00
parent 3b26614d2b
commit a02e924a44

View file

@ -13,10 +13,11 @@
;;;; hsx definitions
(defmacro defhsx (name element-type)
(eval-when (:compile-toplevel :load-toplevel :execute)
`(defmacro ,name (&body body)
(multiple-value-bind (props children)
(parse-body body)
`(create-element ,',element-type (list ,@props) ,@children))))
`(create-element ,',element-type (list ,@props) ,@children)))))
(defun parse-body (body)
(if (keywordp (first body))