Hi,
I have this function for experiment with generating xml from a tree.
(defun read-tags (tree)
(destructuring-bind (tag attrs next) (serapeum:take 3 tree)
(assert (typep tag 'keyword))
(assert (or (typep attrs 'nil)
(typep attrs 'cons)))
(assert (evenp (length attrs)))
(assert (member next '(:content :children)))
attrs
))
the problem is that the assertion does not pick up the odd length attrs list. Is this an SBCL error or I do not understand Lisp?
XML> (assert (evenp (length '(:id))))
; Evaluation aborted on #<SIMPLE-ERROR "~@<The assertion ~S failed~:[.~:; ~
; with ~:*~{~S = ~S~^, ~}.~]~:@>" {100B890BD3}>.
XML> (read-tags '(:interface '(:id) :content))
'(:ID)
XML> (lisp-implementation-version)
"2.3.7.144-9f746524e"
XML>