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

William D Clinger will at ccs.neu.edu
Tue Oct 3 21:50:30 EDT 2006


I am posting this as an individual member of the Scheme
community.  I am not speaking for the R6RS editors, and
this message should not be confused with the editors'
eventual formal response.

Andre van Tonder wrote:
> I think the arguments must be checked up front for all the higher order
> procedures.  This seems to be required by the "must" in sentences to the
> effect:
>
> "an exception must be raised if list is not a plausible list"
>
> in the notes to length and map, which I assume must apply to all these
> procedures.  So an exception has to be raised in this case, right?

Yes.  For a simpler example, consider

    (let ((circular (list 0)))
      (set-cdr! circular circular)
      (for-each (lambda (x)
                  ((lambda (f) (f f))
                   (lambda (f) (f f))))
                circular))

The draft R6RS clearly states that the for-each procedure
must raise an exception for the above example.  Please
note that I am not endorsing this detail of the draft
R6RS.

Will



More information about the r6rs-discuss mailing list