format
This commit is contained in:
parent
4356e4019f
commit
c70c000d73
1 changed files with 9 additions and 9 deletions
|
@ -43,15 +43,15 @@
|
||||||
;;;; factory
|
;;;; factory
|
||||||
|
|
||||||
(defun create-element (type props children)
|
(defun create-element (type props children)
|
||||||
(make-instance (cond ((functionp type) 'component)
|
(make-instance
|
||||||
|
(cond ((functionp type) 'component)
|
||||||
((eq type :<>) 'fragment)
|
((eq type :<>) 'fragment)
|
||||||
((eq type :html) 'html-tag)
|
((eq type :html) 'html-tag)
|
||||||
((keywordp type) 'tag)
|
((keywordp type) 'tag)
|
||||||
(t (error "element-type must be either a keyword or a function.")))
|
(t (error "element-type must be a keyword or a function.")))
|
||||||
:type type
|
:type type
|
||||||
:props props
|
:props props
|
||||||
:children (flatten children)))
|
:children (flatten children)))
|
||||||
|
|
||||||
(defun flatten (x)
|
(defun flatten (x)
|
||||||
(labels ((rec (x acc)
|
(labels ((rec (x acc)
|
||||||
(cond ((null x) acc)
|
(cond ((null x) acc)
|
||||||
|
|
Loading…
Reference in a new issue