[m-dev.] for review: additions to bag.m (repost)

Andrew Bromage bromage at cs.mu.OZ.AU
Tue Mar 10 15:38:18 AEDT 1998


G'day.

Fergus Henderson wrote:

> I suggest you insert a line containing only a "%" between the
> comment and the pred declaration.
> 
> 	%	bag__remove_list(Bag0, RemoveList, Bag) :-
> 	%		bag__from_list(RemoveList, RemoveBag),
> 	%		bag__is_subbag(RemoveBag, Bag0),
> 	%		bag__subtract(Bag0, RemoveBag, Bag).
> 	%
> :- pred bag__remove_list(bag(T), list(T), bag(T)).
> :- mode bag__remove_list(in, in, out) is semidet.

Done.

While we're at it, I've done it with every other comment in bag.m too.
There were a few that needed it especially, such as:

	% bag__subtract(Bag0, SubBag, Bag)
	% subtracts SubBag from Bag0 to produce Bag
	% each element in SubBag is removed from Bag0 to produce Bag.
	% If an element exists in SubBag, but not in Bag, then that
	% element is not removed.
	% e.g. bag__subtract({1, 1, 2, 2, 3 }, {1, 1, 2, 3, 3, 3}, {2}).
:- pred bag__subtract(bag(T), bag(T), bag(T)).
:- mode bag__subtract(in, in, out) is det.

If anyone thinks this is a bad idea, speak now.

Cheers,
Andrew Bromage



More information about the developers mailing list