[r6rs-discuss] [Formal] Requirement to detect circular lists

From: dyb_at_cs.indiana.edu <dyb>
Date: Tue Oct 3 09:54:40 2006

> I think the spirit of R6RS is that, if one wants such an extension,
> an implementation should have two modes (or two libraries),
> r6rs-compliant mode and extension mode, and only raise an
> exception in r6rs-compliant mode.

That's correct.

> I understand the importance of portable semantics. Yet a question
> remains: what do we gain by limiting the domain of 'map' to plausible
> lists of length-n, instead of explicitly allowing circular lists and/or
> lists of different lengths (e.g. plausible lists up to n).

By extending the domain of map, we would allow some map calls to produce
values that would otherwise have raised exceptions. In some cases, this
behavior would be desirable; in others, it would mask errors in the
program. I suspect that the latter will more often be the case. Whether
this is true or not, I believe that it's better to err on the safe side
(and raise the exception), especially given the ease with which
programmers can create their own versions of map that are tailored to
specific applications.

Kent
Received on Tue Oct 03 2006 - 09:53:57 UTC

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