Class Wb-Bag

A class of functional bags (multisets) represented as weight-balanced binary
trees. This is the default implementation of bags in FSet.

Part of:

package fset, class bag

Direct Superclass

bagThe abstract class for FSet functional bags (multisets). It is a structure
class.

Slot

contents

Direct Method

arbReturns an arbitrary member or pair of a set, bag, or map. Specifically,
on a nonempty set, retu...
at-rankOn a set, returns the element with rank rank; on a bag, returns
that element with its multiplic...
bag-differenceReturns a bag whose multiplicity, for any value, is its multiplicity
in bag1 less that in bag2...
bag-productReturns a bag whose multiplicity, for any value, is the product of
its multiplicities in the two ...
bag-sumReturns a bag whose multiplicity, for any value, is the sum of its
multiplicities in the two argu...
compareReturns one of :less, :greater, :equal, or :unequal according as x
is less than, greate...
contains?Returns true iff the set or bag contains x.
convertConverts the collection to the specified type. Some methods may
take additional keyword argument...
empty?Returns true iff the collection is empty.
greatestOn a set, returns two values: the greatest member of the set and
true; on a bag, returns three va...
internal-do-bag-pairsCalls elt-fn on successive pairs of the bag (the second argument is
the multiplicity); when don...
intersectionReturns the intersection of the two sets/bags. The result is a bag
if both arguments are bags; o...
iteratorReturns an iterator for the collection. (These are stateful iterators and
are not thread-safe; i...
leastOn a set, returns two values: the smallest member of the set and
true; on a bag, returns three va...
lessOn a set, removes value1 from it if present, returning the updated set.
On a bag, removes valu...
lookupIf collection is a map, returns the value to which key is mapped.
If collection is a seq, t...
multiplicityReturns the multiplicity of x in the bag.
rankIf collection is a set or bag that contains value, returns the rank of
value in the orderin...
set-sizeReturns the number of unique members in the bag.
sizeReturns the number of members in a set, seq, or bag, or the number of
pairs in a map. The size o...
subbag?Returns true iff sub is a subbag of super, that is, for every
member of sub, super contai...
unionReturns the union of the two sets/bags. The result is a set if both
arguments are sets; otherwis...
verify
withOn a set, adds value1 to it, returning the updated set. On a bag, adds
value2 occurrences of...

Other Method

countIf collection is a Lisp sequence, this simply calls cl:count. On an FSet
collection, the def...
count-ifIf collection is a Lisp sequence, this simply calls cl:count-if. On an
FSet collection, the ...
count-if-notIf collection is a Lisp sequence, this simply calls cl:count-if-not.
On an FSet collection, t...
filterReturns a new collection containing those members or pairs of collection
for which fn returns...
findIf collection is a Lisp sequence, this simply calls cl:find. On an FSet
collection, the defa...
find-ifIf collection is a Lisp sequence, this simply calls cl:find-if. On an
FSet collection, the ...
find-if-notIf collection is a Lisp sequence, this simply calls cl:find-if-not.
On an FSet collection, th...
imageReturns a new collection containing the result of applying fn to each
member of collection, w...
reduceIf collection is a Lisp sequence, this simply calls cl:reduce (q.v.).
On an FSet collection, ...