[racket] feedback on migrating to immutable pairs?

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Sun Jun 13 11:26:30 EDT 2010

On Sun, Jun 13, 2010 at 2:51 AM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> 2. What was the rationale for not having "pair?", "car", "cdr", work on both
> mutable pairs and immutable pairs?  Was this to push everyone harder towards
> immutable pairs, at the cost of having to convert legacy libraries and
> breaking R5RS compatibility?

Having immutable and mutable pairs be distinct turns out to be very
valuable for Typed Scheme/Racket.  Mutable pairs support more
operations, so in one sense they should be subtypes of pairs in
general.  But mutable pairs support fewer equations, and so cannot be
used in places where immutable pairs are allowed, so cannot be treated
as subtypes.  This makes the story for hashtables, vectors and boxes
much more complex, and I'm happy that it's not the case for pairs.
-- 
sam th
samth at ccs.neu.edu


Posted on the users mailing list.