[m-rev.] for review: map.select_unselect

Zoltan Somogyi zoltan.somogyi at runbox.com
Wed Jun 5 22:07:57 AEST 2019



On Wed, 5 Jun 2019 20:43:14 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
> I think the names are fine (or at least I failed to thing up anything
> better).

Same here.

> > +    % select_unselect_sorted_list takes a map and a sorted list of keys,
> > +    % and returns two maps:
> > +    % the first containing the keys in the list and their corresponding values,
> > +    % the second containing the keys NOT in the list and their corresponding
> > +    % values.
> 
> What if the list contains duplicate elements?

It must not. This is the same restriction as on the old select_sorted_list.
In most cases, the sorted list comes from an intrinsically-duplicate-free
source, such as the keys of another map.

I will extend the comments on both predicates to cover this.
 
> Could you please also add a test cases the exercises the new predicates.
> (Or extend an existing on if appropriate.)

Will do.

Zoltan.


More information about the reviews mailing list