[E-Lang] An Attempted Restatement of Hydro's Semantics

Tyler Close tclose@oilspace.com
Fri, 06 Apr 2001 13:15:28 +0100


At 06:52 PM 4/2/01 +0100, Tyler Close wrote:
>At 08:08 AM 4/2/01 -0700, Mark S. Miller wrote:
>>In the union of two such multi collections, even a full ordering function
>>would not determine the resulting order.  You must use creation order to
>>deterministically decide whether the result is
>>[ "MarkM", "markm" ] or [ "markm", "MarkM" ].
>
>For a unique set:
>
>     [ "MarkM" ] | [ "markm" ] == [ "MarkM" ]
>
>For a replace set:
>
>     [ "MarkM" ] | [ "markm" ] == [ "markm" ]
>
>For a multiset:
>
>     [ "MarkM" ] | [ "markm" ] == [ "MarkM" ]
>
>and
>
>     [ "MarkM", "mARKm" ] | [ "markm" ] == [ "MarkM", "mARKm" ]
>
>and
>
>     [ "MarkM" ] | [ "markm", "mARKm" ] == [ "MarkM", "mARKm" ]

When I wrote this, it occured to me that this is a little strange, since I 
want "|" to be a "withAll" operation. I originally implemented multiset 
union in this way because this is the way the C++ STL does it. See:

http://www.sgi.com/tech/stl/set_union.html

I decided to sit on this thought for a couple days and see what happened. I 
haven't found any compelling reason to prefer the STL definition of union, 
so I have modified it to be what MarkM suspected it should be.

For a sorted multi set:

     [ "MarkM" ] | [ "markm" ] == [ "MarkM", "markm" ]

The latest version of Hydro is at:

http://www.waterken.com/Hydro/2.0/doc/abridged-index.html

This version has the updated union semantics as well as the indexable 
Initializer.

Tyler