Improve
This commit is contained in:
parent
9ad84f970c
commit
ab1d321cab
4 changed files with 9 additions and 10 deletions
|
@ -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)))
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(uiop:define-package #:hsx/hsx
|
||||
(defpackage #:hsx/hsx
|
||||
(:use #:cl)
|
||||
(:export #:hsx))
|
||||
(in-package #:hsx/hsx)
|
||||
|
|
Loading…
Reference in a new issue