[r6rs-discuss] Laziness Features
William D Clinger
will at ccs.neu.edu
Wed Oct 18 10:19:13 EDT 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
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.
More information about the r6rs-discuss