John Cowan <xxxxxx@ccil.org> schrieb am So., 2. Juli 2017 um 23:08 Uhr:

On Sun, Jul 2, 2017 at 4:36 PM, Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:

So, mapping? would return #f on all existing objects and on all possible return values of existing procedures, where "existing" means "existing in the Scheme process before the mapping library was loaded".

Well, that's clear enough, but I don't think it's *strong* enough.  It excludes the possibility that `mapping?` returns #t on a pair, but not the possibility that `pair?` returns #t on a mapping, in case someone were dumb enough to implement a mapping as a raw alist.

This would not be possible, would it? If ‘pair?’ returned ‘#t’ on a mapping (implemented as raw alists), it would have to be a pair. Now, ‘mapping?’ has to return ‘#t’ on mappings, so would return ’#t’ at least on some pairs. And this would be forbidden (at least if (scheme base) had been loaded when (srfi 146) was loaded).

Disjointness is complicated.  For example, I've been wondering if SRFI 14 character sets really must be disjoint from SRFI 103 general sets.  They are both linear-update, so that's not a problem, and covariance/contravariance is not an issue either, because there is no overloading in (standard) Scheme.  So loosening the disjointness constraint would just mean that in some implementations, general set operations would work on character sets, and in some implementations they would not, which is in the scope of "it is an error".  The same issue will come up again fairly soon with the forthcoming integer-set SRFI. 

I am still inclined to kick the can down the road for future resolution.

I am still hesitant to add a requirement (that of mappings being disjoint other Scheme types) to that SRFI when we already know that it has unclear semantics.

However, not adding any requirement would most likely not be strong enough (and could mean that this SRFI would have to be amended when "disjointness from other Scheme types" will have been clarified in the other SRFIs).

--

Marc
 

-- 
John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
Statistics don't help a great deal in making important decisions.
Most people have more than the average number of feet, but I'm not about
to start a company selling shoes in threes. --Ross Gardler