On Wed, Feb 20, 2013 at 8:18 AM, Bill Wood <william.wood3 at comcast.net>wrote:
>
> IIUC a function call returns ALL the values returned by the last form in
> its body; that's what I understand an implicit progn to be. It seems to
> be the responsibility of the caller to handle multiple return values
> with one of the operators that handle multiple values. Section 3.1.7
> (Return Values) of the hyperspec seems pretty clear on this. So it
> seems to me that an implementation cannot make such an assumption.
>
Perhaps you have just misstated the semantics. It is true that the called
function always returns the zero-or-more values returned by the last
executed form, but there is no "responsibility" on the calling function.
If it does nothing special, it receives just the principal value (if any).
If the called function returns fewer values than the caller expects, the
missing values are nil. If too many, the extra values are quietly
discarded.
There is more variance allowed if the called function is declared. The
compiler might optimize some mv away in any particular call, provided
precise semantics are preserved. And if the declaration is not obeyed by
the called function, the ANS permits earthquakes, volcanoes, cats living
with dogs, ...