[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Type specifiers in THE constructs



Is there agreement that only aware callers need to know about
multiple values?  I have the impression that many decisions already
in the language point to the desire to avoid burdening an unaware
caller.

If there is agreement, the best interpretation for the type
specifier in a THE form would be:

    1-  If the specifier is of the form (VALUES ...), then it
        applies to the potentially many return values of the second
        subform of THE.  (Subject to someone solving the question of
        what exactly &REST means.)  [Doubt:  I would like to say
        that declaring fewer values than actually returned is OK and
        declares only those, while declaring more values than
        actually returned `signals an error'.  Is that consistent
        with the rest?  This is in line with the (possibly
        dangerous) assumption that if it is safe to return more than
        1 value when your caller expected one exactly, it should be
        fine to return more than N values when your caller is
        willing to use only N of those.]

    2-  Otherwise, it refers to the first or only value returned.

So, I would say that (THE NUMBER (TRUNCATE 10 3)) should be legal
(should even continue returning the multiple values), but should be
read as constraining only the first of the returned values to be
NUMBERP.

=Cesar
--------
Cesar Augusto  Quiroz Gonzalez

Department of Computer Science     ...allegra!rochester!quiroz
University of Rochester            or
Rochester,  NY 14627               quiroz@cs.rochester.edu