[Mono-dev] FW: [Bug 349875] Dictionary<TKey, TValue> stores values out of order.

Zoltan Varga vargaz at gmail.com
Thu Dec 20 08:54:03 EST 2007


Hi,

  We do try to mimic MS behaviour but this case is hard to solve, as
what seems to
be the MS behaviour is probably just an accident due to their implementation of
GetHashCode.

            Zoltan

On Dec 19, 2007 8:40 PM, Josh Mouch <josh at mouch.name> wrote:
> I recall reading somewhere that when possible, mono will try to mimic the
> behavior of .Net, to make it easier for people to migrate from the later to
> the former.  I can't find that reference now, so maybe it's all in my head.
> :)
>
>
> -----Original Message-----
> From: Juraj Skripsky [mailto:js at hotfeet.ch]
> Sent: Wednesday, December 19, 2007 2:17 PM
> To: Josh Mouch
> Cc: mono-devel-list at lists.ximian.com
> Subject: Re: FW: [Bug 349875] Dictionary<TKey, TValue> stores values out of
> order.
>
> Hi Josh,
>
> Mono is support to follow the MS .net _design_ not the _implementation_.
> If the docs don't state that you can depend on the order of the
> elements, you shouldn't do so. I consider an app relying on this order
> to be buggy.
>
> - Juraj
>
> PS: please always send a copy of such mails to the mailing lists. Others
> might be interested.
>
>
> On Wed, 2007-12-19 at 14:09 -0500, Josh Mouch wrote:
> > Isn't mono supposed to mimic MS .Net behavior?
> >
> > Josh
> >
> > -----Original Message-----
> > From: bugzilla_noreply at novell.com [mailto:bugzilla_noreply at novell.com]
> > Sent: Wednesday, December 19, 2007 2:07 PM
> > To: josh+novell at mouch.name
> > Subject: [Bug 349875] Dictionary<TKey, TValue> stores values out of order.
> >
> > https://bugzilla.novell.com/show_bug.cgi?id=349875
> >
> > User juraj at hotfeet.ch added comment
> > https://bugzilla.novell.com/show_bug.cgi?id=349875#c1
> >
> >
> > Juraj Skripsky <juraj at hotfeet.ch> changed:
> >
> >            What    |Removed                                         |Added
> >
> ----------------------------------------------------------------------------
> >                  CC|
> |juraj at hotfeet.ch
> >              Status|NEW
> |RESOLVED
> >          Resolution|
> |INVALID
> >
> >
> >
> >
> > --- Comment #1 from Juraj Skripsky <juraj at hotfeet.ch>  2007-12-19 12:06:33
> MST ---
> > According to MS.NET docs, this behavior is perfectly fine for the Values
> > property (see
> > http://msdn2.microsoft.com/en-us/library/ekcfxy3x.aspx):
> >
> > "The order of the values in the Dictionary<(Of <(TKey,
> > TValue>)>)..::.ValueCollection is unspecified, but it is the same order as
> the
> > associated keys in the Dictionary<(Of <(TKey, TValue>)>)..::.KeyCollection
> > returned by the Keys property."
> >
> > As for the enumeration of the Dictionary'2 itself, the documentation does
> not
> > state a required ordering of the returned elements.
> >
> > Setting to resolved/fixed.
> > Please reopen if the docs support your claim.
> >
> >
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>



More information about the Mono-devel-list mailing list