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

Manuel Serrano Manuel.Serrano
Fri Oct 15 03:11:02 EDT 2004

> While I'm waiting for some of the details in Manuel's, Richard's and my
> discussion on modules to firm up, I thought it might make sense to
> continue this discussion.
> I propose we remove SET-CAR! and SET-CDR! from the language, thereby
> making all pairs immutable.
> The advantages are many and hopefully clear to everyone here---among
> them:
> - they're really redundant, given that vectors are mutable
> - unpleasant consequences of their presence for argument lists go away
> - a lot of code out there will get cleaner
> Disadvantages: Lots (and lots) of code will break.  However, a
> majority of those polled at the workshop were for ditching them.
> Issues:
> - Should mutable pairs be provided as part of some R5RS compatibility
>   library, as we're envisioning for arithmetic?  (And should those
>   pairs be interchangeable with R6RS immutable pairs when it comes to
>   applying one or the other CAR, say.)
> - Many programs that presently use SET-CAR! & SET-CDR! presumable
>   would switch to using cells inside the pairs.  Should R6RS therefore
>   offer a default cell data type?  (There seemed to be a consensus
>   that there shouldn't, but the rationale is unclear to me.)
> Comments?
I'm strongly against this proposal. In my opinion, mutable pairs is strong
characteristic of Lisp. It enables efficient, and sometime simpler, 
implementation of tree manipulation. 

This is because Lisp and Scheme do have side effects on variables and
data structures that I have always preferred them to, let's say, CAML.


More information about the R6RS mailing list