Define the exact length of question

This commit is contained in:
Marcus Kammer 2023-09-20 13:32:31 +02:00
parent 31cbd9edc4
commit e7570c2721

View file

@ -65,12 +65,14 @@ A valid question is a list of alternating keywords and either strings or lists
satisfying `choicesp`.
Returns T if it's a valid question, otherwise NIL."
(loop for i from 0 below (length lst)
for elem = (nth i lst)
always (if (evenp i)
(keywordp elem)
(or (stringp elem)
(choicesp elem)))))
(if (= (length lst) 6)
(loop for i from 0 below (length lst)
for elem = (nth i lst)
always (if (evenp i)
(keywordp elem)
(or (stringp elem)
(choicesp elem))))
nil))
(deftype question ()
"Represents a valid question list.