diff --git a/src/element.lisp b/src/element.lisp index 09c41e4..22b18db 100644 --- a/src/element.lisp +++ b/src/element.lisp @@ -21,6 +21,15 @@ (and children (list :children (flatten children)))))) +(defmethod expand ((elm element)) + (with-accessors ((kind element-kind) + (props element-props)) elm + (if (functionp kind) + (apply kind props) + elm))) + +;;;; utils + (defun flatten (x) (labels ((rec (x acc) (cond ((null x) acc) @@ -29,10 +38,3 @@ (car x) (rec (cdr x) acc)))))) (rec x nil))) - -(defmethod expand ((elm element)) - (with-accessors ((kind element-kind) - (props element-props)) elm - (if (functionp kind) - (apply kind props) - (error "element-kind is not a function."))))