This commit is contained in:
paku 2024-05-28 20:15:29 +09:00
parent 9ad84f970c
commit ab1d321cab
4 changed files with 9 additions and 10 deletions

View file

@ -6,7 +6,7 @@
(defmacro define-and-export-builtin-elements (&rest names)
`(eval-when (:compile-toplevel :load-toplevel :execute)
`(progn
,@(mapcan (lambda (name)
(list `(deftag ,name)
`(export ',name)))

View file

@ -1,4 +1,4 @@
(uiop:define-package #:hsx/defhsx
(defpackage #:hsx/defhsx
(:use #:cl)
(:import-from #:alexandria
#:make-keyword
@ -11,11 +11,10 @@
(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)))))
`(defmacro ,name (&body body)
(multiple-value-bind (props children)
(parse-body body)
`(create-element ,',element-type (list ,@props) ,@children))))
(defun parse-body (body)
(if (keywordp (first body))

View file

@ -1,9 +1,9 @@
(defpackage #:hsx/element
(:use #:cl)
(:export #:element-type
(:export #:create-element
#:element-type
#:element-props
#:element-children
#:create-element
#:expand-component))
(in-package #:hsx/element)

View file

@ -1,4 +1,4 @@
(uiop:define-package #:hsx/hsx
(defpackage #:hsx/hsx
(:use #:cl)
(:export #:hsx))
(in-package #:hsx/hsx)