Re: [Caja] Equality of mappings in E

Kevin Reid <[email protected]>
Newsgroups gmane.comp.lang.e.general
Message-ID <[email protected]>
On Mar 10, 2009, at 16:28, Mark S. Miller wrote:
> On Tue, Mar 10, 2009 at 11:01 AM, David-Sarah Hopwood <david.hopwood-mRVxzIiVagSlV3Ge8JjJtnfLna9zW77MtUK59QYPAWc@public.gmane.org 
> > wrote:
>
> Mark S. Miller wrote:
> > The corresponding cases in E without quasis:
> >
> >     ? ["a" => 1, "b" => 2] == ["b" => 2, "a" => 1]
> >     # value: false
> >
> > They aren't equal because they are different.
>
> I'm surprised. The ASTs of the left- and right-hand sides are  
> certainly
> different, but this is testing whether the values are the same.
> Why aren't the values the same?
>
> [Feel free to move this to e-lang.]
>
> Because their enumeration order is different.

Note that if the maps are restricted to have string keys, then it is  
not impossible to canonicalize the enumeration order.

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.