compilator: fixes issue #3 (regression on package :lapack).
authorDaniel Kochmański <dkochmanski@hellsgate.pl>
Thu, 5 Mar 2015 22:45:22 +0000 (23:45 +0100)
committerDaniel Kochmański <dkochmanski@hellsgate.pl>
Thu, 5 Mar 2015 22:45:22 +0000 (23:45 +0100)
cmptype-arith.lsp: problem introduced in commit
c0b23555c67c24c7ddb23bc2a0f2129754c2058a which added empty &optional
clause and &allow-other-keys capability to typespec for values.

Problem was, that multiple &optional keywords in typespec it
considered error, while

'(VALUES &OPTIONAL T &OPTIONAL T)

should return as optional part, list (T &optional T) - even if it
looks weird.

src/cmp/cmptype-arith.lsp

index 7416bbe..bceabf2 100644 (file)
                  (when l
                    (cmperr "Syntax error in type expression ~S" type)))
                 (&optional
-                 (when optional-flag
-                   (cmperr "Syntax error in type expression ~S" type))
-                 (setf optional-flag t))
+                 (if optional-flag
+                     (push typespec optional)
+                     (setf optional-flag t)))
                 (&rest
                  (when (or (null l)
                            (not (member (rest l) '(() (&allow-other-keys))