Commit c3843ff9333358166a7e258fae16b0cb5b1d92b5

Thomas de Grivel 2020-04-13T12:54:07

use typecase

diff --git a/core/spec.lisp b/core/spec.lisp
index 891eef9..6d9106a 100644
--- a/core/spec.lisp
+++ b/core/spec.lisp
@@ -58,14 +58,13 @@
   (loop
      (when (endp spec)
        (return))
-     (if (consp (first spec))
-         (progn
-           (parse-specification res (first spec))
-           (setq spec (rest spec)))
-         (let ((next-spec (parse-next-specification res spec)))
-           (when (eq spec next-spec)
-             (error "Invalid specification : ~S" spec))
-           (setq spec next-spec))))
+     (typecase (first spec)
+       (cons (parse-specification res (first spec))
+             (setq spec (rest spec)))
+       (t (let ((next-spec (parse-next-specification res spec)))
+            (when (eq spec next-spec)
+              (error "Invalid specification : ~S" spec))
+            (setq spec next-spec)))))
   res)
 
 #+nil