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

From: Shiro Kawai <shiro>
Date: Tue Oct 3 06:28:51 2006

From: Abdulaziz Ghuloum <aghuloum_at_cs.indiana.edu>
Subject: Re: [r6rs-discuss] [Formal] Requirement to detect circular lists
Date: Tue, 3 Oct 2006 06:01:32 -0400

> On Oct 3, 2006, at 5:38 AM, Dan Muresan wrote:
>
> > So in the end, circular lists seem easier to create, more efficient,
> > and potentially safer *for the periodic case*.
>
> Just in case you haven't been paying attention, mutable pairs were
> considered for removal from Scheme at some point in time. The final
> resolution was to keep them in their own (r6rs mutable-pairs) little
> library that is not even imported by default when you import r6rs.
>
> set-car! and set-cdr! are a thing from the past and I sure hope that
> R6RS is the last Scheme standard to support them. The benefits from
> dropping mutable pairs far outweigh the alleged benefits of making
> map, length, and friends accept circular lists. Just my opinion.

Removing mutable pairs certaily make reasoning on a program
much easier.

Nonetheless, it is a new restriction. And we need another
set of features (such as lazy lists, and whole set of lazy-version
of functions such as lazy-car, lazy-cdr, lazy-map...) to express
the same concept. Now, R6RS Introduction still begins with the
famous sentence ("Programming languages should be designed ..."
I don't need to quote it, do I?)

And I think you are comparing somewhat different things in your
last paragraph. If the future RnRS doesn't have mutable pairs,
'map' will never receive a circular lists in RnRS compliant code
(since there's no such thing like a circular lists in RnRS world),
so the standard doesn't need to say "'map' MUST raise an
exception when its argument is a circular list." at all.
An implementation could have circular lists as its extension,
and make 'map' accept them as a natural extension, without
conflicting to RnRS.

I'm not against set-c*r! fading away. But it doesn't seem to
justify the "plausible lists of length n" restriction in R6RS.

--shiro
Received on Tue Oct 03 2006 - 06:30:06 UTC

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