Announcing E 0.8.4: The Birthday Release
Mark S. Miller
markm@caplet.com
Fri, 28 May 1999 09:20:30 -0700
At 03:44 PM 5/27/99 , Chip Morningstar wrote:
>The mind reels to consider what the question is to which you are the answer.
[?] Ah, but what is the question to which this very question is the answer?
>Is there some semantic trouble we would get into by adding an
>'implementsSameMapping' method (feel free to substitute a better name)
>to the table protocol? It strikes me that the circumstances under
>which you want to compare two tables are sufficiently specialized that
>a specialized method would not be overly burdensome from the user's
>perspective.
[+] This is probably a good idea
[-] Why I resist for now:
I'm desperately trying to keep the number of different equality-like
queries down to a dull roar. So far I only have two:
x == y
as documented in the previous release notes. And
x |=| y
meaning that x and y are equivalent in their natural partial ordering.
This is a peer to <, <=, >=, and >. Think of 'x |=| y' as 'x <= y && x >= y'.
The natural partial ordering for maps is according to a subset relationship
of their keys, so
x < y # the keys of x are a strict subset of the keys of y
x <= y # subset
x |=| y # the same set of keys
x >= y # superset
x > y # strict superset
Since the |=| applies independent of key order, I am hoping that these two
would be adequate. Since both of these query operations apply across the
language, we amortize the cost of learning them. If, under actual use, we
find good cases where we want the map-specific operation you suggest, I
will add it.
Btw, I think we need a better name. "implements" has all the wrong
implications. The issue is fully defined by the semantics of the two maps.