The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (07 May 2020 08:00 UTC)
Re: The Liskov Substitution Principle in the Rationale John Cowan (12 May 2020 03:06 UTC)
Re: The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (12 May 2020 06:27 UTC)
Re: The Liskov Substitution Principle in the Rationale Arthur A. Gleckler (12 May 2020 19:58 UTC)
Re: The Liskov Substitution Principle in the Rationale John Cowan (12 May 2020 20:10 UTC)
Re: The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (12 May 2020 21:16 UTC)
Re: The Liskov Substitution Principle in the Rationale John Cowan (12 May 2020 23:06 UTC)
Re: The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (13 May 2020 13:59 UTC)
Re: The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (14 May 2020 21:30 UTC)
Re: The Liskov Substitution Principle in the Rationale John Cowan (16 May 2020 01:03 UTC)
Re: The Liskov Substitution Principle in the Rationale Shiro Kawai (16 May 2020 01:18 UTC)
Re: The Liskov Substitution Principle in the Rationale John Cowan (16 May 2020 03:08 UTC)
Re: The Liskov Substitution Principle in the Rationale Shiro Kawai (16 May 2020 03:31 UTC)
Re: The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (16 May 2020 13:51 UTC)
Re: The Liskov Substitution Principle in the Rationale Arthur A. Gleckler (16 May 2020 18:40 UTC)
Re: The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (16 May 2020 18:55 UTC)
Re: The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (16 May 2020 21:17 UTC)
Re: The Liskov Substitution Principle in the Rationale Shiro Kawai (16 May 2020 21:47 UTC)
Re: The Liskov Substitution Principle in the Rationale John Cowan (23 May 2020 00:00 UTC)
Re: The Liskov Substitution Principle in the Rationale Arthur A. Gleckler (23 May 2020 00:09 UTC)
Re: The Liskov Substitution Principle in the Rationale John Cowan (23 May 2020 00:10 UTC)
Re: The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (23 May 2020 10:58 UTC)
Re: The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (23 May 2020 13:02 UTC)
Re: The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen (16 May 2020 18:41 UTC)

The Liskov Substitution Principle in the Rationale Marc Nieper-Wißkirchen 07 May 2020 08:00 UTC

In the rationale section it says:

"Because of the Liskov Substitution Principle, it is not possible to
treat [im]mutable pairs as either a subtype or a supertype of mutable
ones; they must be distinct, ..."

To make sense of this, one has to understand what is meant by subtype
or supertype in the context of Scheme and, moreover, what is meant by
the type of immutable pairs and the type of mutable pairs.

The naive answer would be that the type of immutable pairs is defined
by the collection of Scheme objects, for which the predicate `ipair?`
returns true, and the type of mutable pairs is defined by the
collection of Scheme objects, for which the predicate `pair?` returns
true. Being a subtype or a supertype would then refer to whether one
collection is sub- or a supercollection of the other.

This cannot be the answer, though, as SRFI 116 would otherwise
contradict itself: SRFI 116 recommends that quotations of pairs return
immutable pairs. As `pair?` has to return true when applied to quoted
pairs, this suggests that in these implementations, `pair?` returns
true whenever `ipair?` returns true, which would make mutable pairs a
supertype of immutable ones in this naive interpretation of "type".

Related to this question: Would it be a faithful implementation if all
the procedures exported by SRFI 116 are the same as their mutable
counterparts without the "i"-prefix? In such an implementation, there
does not seem to be any meaningful difference between pairs and
ipairs.