[m-dev.] for review: set__divide

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu Jan 4 16:56:54 AEDT 2001


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.

There is already a *function* set__filter that only returns the elements
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?

Zoltan.
--------------------------------------------------------------------------
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