[m-dev.] for review: set__divide

Simon Taylor stayl at cs.mu.OZ.AU
Thu Jan 4 17:12:44 AEDT 2001


Zoltan wrote:
> On 04-Jan-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > > library/set.m:
> > > library/set_ordlist.m:
> > > library/set_unordlist.m:
> > > 	Add {set,set_ordlist,set_unordlist}_divide.
> > 
> > For consistency with list.m, shouldn't this be called set__filter? 	
> > It's probably also worth adding a version which only returns
> > the part of the set for which the test succeeds.
 
> I could call the new predicate set__filter, but then there would be both
> a function and a predicate with the same name and with slightly different
> functionality. Of course, one could bridge the gap by adding a predicate
> version of the existing set__filter function as well. I don't want to do that,
> because using the same name for different things can cause ambiguities.
> For example, is the term list__filter(test_pred, List) a full application
> of the function or a partial application of the predicate?

I agree with you. Maybe we should add a predicate `list__divide/4' which
is the same as `list__filter/4', and mark `list__filter/4' as obsolete.
It's annoying when two modules have predicates which do the same thing
but have different names.

Simon.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list