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)
|
(defmacro define-and-export-builtin-elements (&rest names)
|
||||||
`(eval-when (:compile-toplevel :load-toplevel :execute)
|
`(progn
|
||||||
,@(mapcan (lambda (name)
|
,@(mapcan (lambda (name)
|
||||||
(list `(deftag ,name)
|
(list `(deftag ,name)
|
||||||
`(export ',name)))
|
`(export ',name)))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
(uiop:define-package #:hsx/defhsx
|
(defpackage #:hsx/defhsx
|
||||||
(:use #:cl)
|
(:use #:cl)
|
||||||
(:import-from #:alexandria
|
(:import-from #:alexandria
|
||||||
#:make-keyword
|
#:make-keyword
|
||||||
|
@ -11,11 +11,10 @@
|
||||||
|
|
||||||
|
|
||||||
(defmacro defhsx (name element-type)
|
(defmacro defhsx (name element-type)
|
||||||
`(eval-when (:compile-toplevel :load-toplevel :execute)
|
`(defmacro ,name (&body body)
|
||||||
(defmacro ,name (&body body)
|
(multiple-value-bind (props children)
|
||||||
(multiple-value-bind (props children)
|
(parse-body body)
|
||||||
(parse-body body)
|
`(create-element ,',element-type (list ,@props) ,@children))))
|
||||||
`(create-element ,',element-type (list ,@props) ,@children)))))
|
|
||||||
|
|
||||||
(defun parse-body (body)
|
(defun parse-body (body)
|
||||||
(if (keywordp (first body))
|
(if (keywordp (first body))
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
(defpackage #:hsx/element
|
(defpackage #:hsx/element
|
||||||
(:use #:cl)
|
(:use #:cl)
|
||||||
(:export #:element-type
|
(:export #:create-element
|
||||||
|
#:element-type
|
||||||
#:element-props
|
#:element-props
|
||||||
#:element-children
|
#:element-children
|
||||||
#:create-element
|
|
||||||
#:expand-component))
|
#:expand-component))
|
||||||
(in-package #:hsx/element)
|
(in-package #:hsx/element)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
(uiop:define-package #:hsx/hsx
|
(defpackage #:hsx/hsx
|
||||||
(:use #:cl)
|
(:use #:cl)
|
||||||
(:export #:hsx))
|
(:export #:hsx))
|
||||||
(in-package #:hsx/hsx)
|
(in-package #:hsx/hsx)
|
||||||
|
|
Loading…
Reference in a new issue