On 1/10/19 5:49 PM, John Cowan wrote:
> It think Scheme should have immutable vectors. SRFI 122 has immutable arrays.
>
> So it does. However, the Liskov Substitution Principle means that mutable
> and immutable collections are not in a subtype-supertype relationship in
> either direction, and the vectors anciently known to Scheme are the mutable kind.
I don't see how this is relevant. Scheme already *does* have both mutable and immutable vectors.
The predicate vector? is true for both. Whether immutable vector are limited to literals
or if there is procedure that creates an immutable vector doesn't change the subtyping issues.
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/