Hi Eli, On Wed 25 May 2011 11:04, Eli Barzilay <[email protected]> writes:
> To make John's point: would you similarly want to ignore (car #f) and > (cons 1 2 3) throwing errors? More importantly, is there any point to > an implementation that would do something else? In the context of > multiple values, not throwing an error when a continuation is applied > to the right number of arguments greatly reduces their utility (as far > as a common convention goes). There is a difference between "errors" and "unspecified behavior", as I'm sure you know. `(car #f)' is an instance of the former; as to the latter, "The effect of passing no value or more than one value to continuations that were not created by call-with-values is unspecified." The R6RS thing of saying that (car #f) must raise an exception of a particular kind was quite annoying. > Chibi's problem Is probably just a bug. I'll assume that's the case; it was a good catch on your part. > Peter talked about chicken's behavior of dropping extra values but > there's no reification; guile breaks (I*M*O) things further and > reifies values but still respects the above Just to clarify: Guile does the Ashley/Dybvig thing (an additional MV return address, and returns to that address expect N values on the stack + number-of-values marker). For continuations created by call-with-values, the correct number of values is required (or an error is signalled). For implicitly single-valued continuations, Guile truncates >1 values to 1 value, and (unlike Chicken) errors if 0 values are returned. I think it's sensible, but hey, folks can disagree (and Ashley and Dybvig did!). I think the R5RS wording is careful and correct. Regards, Andy -- http://wingolog.org/ _______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
