[r6rs-discuss] [Formal] Inappropriate number of values should be defined

From: Martin Gasbichler <gasbichl>
Date: Mon Jan 22 09:27:49 2007

John Cowan <cowan_at_ccil.org> writes:

>
> Report section 9.17, s.v. "values", says that passing an inappropriate
> number of values to a continuation is undefined. I believe it ought to
> be defined thus:
>
> If an expression supplies too many values to its continuation,
> the excess values are discarded. If it supplies too few values,
> the deficient values are set to the unspecified value.
>
> In particular, this paves the way to eliminating "the unspecified value"
> in favor of simply returning zero values.

I think this would be a very bad idea as it gives away an important
opportunity for catching errors at run-time and is therefore likely to
introduce bugs that are hard to find. It also smells like the way
JavaScript and other scripting languages handle the number of
arguments for procedure calls and that caused me a lot of trouble.

Quite the contrary, I think passing an inappropriate number of
arguments to a continuation should be an error for exactly this
reason.


-- 
Martin
Received on Mon Jan 22 2007 - 09:27:10 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC