Move type def to top

This commit is contained in:
Marcus Kammer 2023-09-18 18:21:28 +02:00
parent cc5598b88a
commit 2adc20a7ad
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -30,6 +30,15 @@
(in-package :cl-sbt/questionnaire) (in-package :cl-sbt/questionnaire)
(defun plist-p (lst)
(and (some #'keywordp lst)
(some #'stringp lst)))
(deftype plist ()
'(and list (satisfies plist-p)))
(declaim (ftype (function (plist) list) split-plist-by-keyword))
(defun resolve-input-type (type) (defun resolve-input-type (type)
"Resolve the given input TYPE keyword to the corresponding HTML input type. "Resolve the given input TYPE keyword to the corresponding HTML input type.
@ -120,14 +129,6 @@ Example:
`((process-choice ,group ,choice)))) `((process-choice ,group ,choice))))
(:hr :class (spacing :property "m" :side "y" :size 4))))) (:hr :class (spacing :property "m" :side "y" :size 4)))))
(defun plist-p (lst)
(and (some #'keywordp lst)
(some #'stringp lst)))
(deftype plist ()
'(and list (satisfies plist-p)))
(declaim (ftype (function (plist) list) split-plist-by-keyword))
(defun split-plist-by-keyword (plist) (defun split-plist-by-keyword (plist)
"Splits a property list (PLIST) into a list of smaller property lists, each starting with a keyword. "Splits a property list (PLIST) into a list of smaller property lists, each starting with a keyword.