Re: [Scheme-reports] Seeking review of sets and hash tables proposals
Vassil Nikolov 25 May 2013 21:35 UTC
Per Bothner <per@bothner.com> wrote:
> On 05/25/2013 02:06 PM, Vassil Nikolov wrote:
> >
> >
> > Per Bothner <per@bothner.com> wrote:
> >
> >> On 05/25/2013 01:50 PM, Vassil Nikolov wrote:
> >>>
> >>> Per Bothner <per@bothner.com> wrote:
> >>>
> >>>> ...
> >>>> a bag of T is just
> >>>> a minor optimization of a map (hash-table) from T to integers.
> >>>
> >>> Except when equality only depends on
> >>> parts of the elements.
> >>
> >> I don't understand this comment.
> >
> > If a bag's notion of element equality only
> > takes into account a part of each element
> > and ignores the rest of the element,
> > keeping a count instead of the elements
> > themselves would lose information.
>
> I don't the think the bag API supports this. I.e. using
> a bag will also lose information, unless the bag API is
> clearly specified to support this use case. And I don't
> believe it does.
In any case, I believe it will be better if it
does, or it would be better if it did. My 2e-2.
> ...
> To support this use-case you could use a map that maps
> T to list-of-T. So there is still no strong need for a
> separate bag API.
I'd rather abstain on the latter point, at
least for now.
---Vassil.
2013-05-26.
--
Would you like your metaphors shaken or stirred?
Vassil Nikolov | Васил Николов | <vnikolov@pobox.com>
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports