[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (typep 3 'complex) => t
why don't you use
(deftype complex-number (&optional type)
(if type `(or ,type (complex ,type))
'(or rational complex)))
e.g., (declare (type complex-number x))
means that either X is strictly complex or else a rational, while
(declare (type (complex-number fixnum) x)
means that either X is a fixnum or a (complex fixnum).
It seems well within the bounds of the Common Lisp framework to use
deftype to add types that are interesting to some compilers, without
requiring that the types be added to every other implementation.