From fa7ba1f27e8a35a9f4ed48bb1f58be8826fe376c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Fri, 8 May 2015 20:05:45 +0200 Subject: [PATCH] seq.lib: Recognize (array /type/ 1) as valid sequence subtype. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes erroneous assumption, that for sequence dimension-spec mustn't be an atom. '(array t 1) designates simple-vector of any type and unknown length. Fixes issue #6. Signed-off-by: Daniel KochmaƄski --- src/lsp/seq.lsp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/lsp/seq.lsp b/src/lsp/seq.lsp index 16ff41f92..1ec38e056 100644 --- a/src/lsp/seq.lsp +++ b/src/lsp/seq.lsp @@ -83,13 +83,15 @@ (setq elt-type 'BIT length (if (endp args) '* (first args)))) ((ARRAY SIMPLE-ARRAY) - (when (or (endp (rest args)) - (atom (setq length (second args))) - (endp length) - (not (endp (rest length)))) - (error-sequence-type type)) - (setq elt-type (upgraded-array-element-type (first args)) - length (first (second args)))) + (let ((dimension-spec (second args))) + (cond + ((eql dimension-spec 1) + (setf length '*)) + ((and (consp dimension-spec) + (null (cdr dimension-spec))) + (setf length (car dimension-spec))) + (T (error-sequence-type type)))) + (setq elt-type (upgraded-array-element-type (first args)))) (t ;; We arrive here when the sequence type is not easy to parse. ;; We give up trying to guess the length of the sequence.