Henrik Motakef <usenet-reply@...> writes:
> A related question: If I want to express "this function returns only
> one value, a string", do I really have to write '(function (...)
> (values string &optional))'? Apparently, both '(function (...)
> string)' and '(function (...) (values string))' are automagically
> converted to '(function (...) (values &optional string &rest t))'.
This second would appear to be mandated behaviour by the ANSI
specification, in at least one reading. At least the page for THE
says that missing values in the type specifier default to anything, so
the only way to enforce what you want, portably, would appear to be by
adding the &optional, since FTYPE declarations are equivalent to
wrappping things by equivalent THE forms.
Cheers,
Christophe
--
http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge)
|