Fixed computation of a the values list from a values type: &optional and &rest types must result in an or-type between NULL and the denoted type.

This commit is contained in:
Juan Jose Garcia Ripoll 2009-07-08 21:32:33 +02:00
parent b3b61b59b2
commit 9e5bfb3aa7

View file

@ -183,19 +183,19 @@
(output '())
(n length (1- n)))
((or (null l) (zerop n)) (nreverse output))
(let ((t (pop l)))
(case t
(let ((type (pop l)))
(case type
(&optional
(when (null l)
(cmperr "Syntax error in type expression ~S" type))
(setf t (pop l)))
(setf type (pop l)))
(&rest
(when (null l)
(cmperr "Syntax error in type expression ~S" type))
(setf t (pop l))
(setf type (pop l))
(return-from values-type-to-n-types
(nreconc output (make-list n :initial-element l)))))
(push t output)))))
(push type output)))))
(defun values-type-and (t1 t2)
(labels ((values-type-p (type)