This commit is contained in:
paku 2024-06-05 08:22:14 +09:00
parent 4356e4019f
commit c70c000d73

View file

@ -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)