[r6rs-discuss] Laziness Features

From: William D Clinger <will>
Date: Wed Oct 18 10:19:23 2006

I am posting this as an individual member of the Scheme
community. I am not speaking for the R6RS editors.

Robbie Findler wrote:
> It's not just an implementation issue: abstractions that are safe (ie,
> preserve their invariants) in a set-car!-less world may not in a
> set-car! world.

That's true, but there's a simple rule of thumb for
deciding whether an abstraction that's safe absent
mutability of pairs remains safe when pairs are
mutable: If any pairs that are relevant to the
abstraction could possibly become visible to code
whose contract does not forbid mutation of pairs,
then the abstraction is unsafe when pairs are mutable.

That rule of thumb errs on the conservative side,
but that's the right side on which to err.

It follows that a careful implementor of Scheme
(and all implementors are careful, right?) can
use only abstractions that remain safe when pairs
are mutable, *except* within those pieces of the
standard libraries that are used *only* when pairs
are immutable. As I noted previously, it is easy
for implementors to use different versions of the
standard libraries depending upon whether pairs
are mutable.

Careful programmers can follow the same rule: use
only abstractions that remain safe when pairs are
mutable. Notice, please, that all existing Scheme
code either follows that rule already, or is buggy.

Will
Received on Wed Oct 18 2006 - 10:19:13 UTC

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