immutable pairs in existing implementations Per Bothner (17 Sep 2014 16:50 UTC)
Re: immutable pairs in existing implementations John Cowan (17 Sep 2014 17:45 UTC)
Re: immutable pairs in existing implementations Per Bothner (18 Sep 2014 07:10 UTC)

immutable pairs in existing implementations Per Bothner 17 Sep 2014 16:49 UTC

Kawa already supports both immutable pairs and mutable pairs, as
separate data types.  It is plausible that other implementations also do.
(Clearly Racket does.)  It seems very desirable to use the existing immutable
pair data structures for  SRFI-116 immutable pairs.  However, SRFI-116 causes
some problems.

Consider the analogy with immutable and immutable strings.  Functions like
string-ref can be applied to either kind of string.  It seems reasonable to
let car and cdr apply to both mutable and immutable strings, at least as an
implementation option.

In an implementation with "native" immutable pairs, a quoted list should
return an immutable list.  For consistency, a quasi-quoted list should
also return an immutable list.

For quote/read identity (which is not essential but is desirable, especially if
you might have circular lists) read should be allowed to return an immutable
list.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/