From e7570c2721af58d6ce004c99bbfce8e7c4a7ef66 Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Wed, 20 Sep 2023 13:32:31 +0200 Subject: [PATCH] Define the exact length of question --- src/pattern/questionnaire.lisp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/pattern/questionnaire.lisp b/src/pattern/questionnaire.lisp index 1897a5d..3eb7402 100644 --- a/src/pattern/questionnaire.lisp +++ b/src/pattern/questionnaire.lisp @@ -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.