[m-rev.] for review: fix behaviour of bimap.from_assoc_list

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Mar 7 15:34:59 AEDT 2005


On Mon, 7 Mar 2005, Ian MacLarty wrote:

> Julien Fischer wrote:
> > For review by anyone.
> >
> > Estimated hours taken: 0.5
> > Branches: main, release
> >
> > Change the implementation of bimap.from_assoc_list so that
> > it throws an exception if the association list does not
> > implicitly define a bijection.  At the moment it is possible
> > to use it to create bimaps that are not bijections.
> >
>
> It would be better if there were a version that just failed, since then
> the user wouldn't need to check the bijective property before calling
> bimap.from_assoc_list.  This would also be more consistent with other
> conversion predicates like string.to_int which fail if the conversion is
> not possible.  I suggest the version which throws an exception should
> have the usual "det_" prefix.
>

Arguably we should do that but for the sake of backwards compatibility
I thought I would leave the existing version as det.  (I could add a
version semidet_from_assoc_list), although in the long run I would
prefer your suggestion as well.

Opinions?

Cheers,
Julien.

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list