[R6RS] Re: Zapping SET-CAR! & SET-CDR!

R. Kent Dybvig dyb
Wed Oct 20 14:06:31 EDT 2004


> I would be a lot happier with having both mutable and immutable
> pairs, although it leaves open the question of which kind of pair
> MAP, APPEND, and other procedures create.  Having both might be
> a problem for some implementations.

I prefer that all pairs be immutable.  Failing that, I prefer that all
pairs be mutable.

My reason for wanting immutable pairs is to allow the compiler to do
deforestation, i.e., reduce the number of intermediate data structures
produced by code that does a lot of mapping, appending, reversing,
etc., so that people who are concerned with efficiency can feel free
to write such code.  The possible presence of mutable pairs complicates
deforestation and reduces the likelihood of success to the point where
it is probably not worth the implementation and compile-time costs.

Thus, having some mutable and some immutable pairs holds no attraction
for me.  Since having both makes the language more complex, I prefer
all mutable to some mutable and some immutable.

Kent


More information about the R6RS mailing list