fset
A functional settheoretic collections library. See: http://www.ergy.com/FSet.html
FSET

GenericFunction
COMPARE
(x y)Returns one of `:less', `:greater', `:equal', or `:unequal' according as `x' is less than, greater than, or equal to `y', or none of these. While the ordering does not have to be total, it must be consistent: for two values A and B that compare `:unequal' to each other, for any third value C, if A compares `:less' or `:greater' to C, then B must compare to C the same way; and no more than one of A and B can compare `:equal' to C. 
Function
EQUAL?
(a b) 
Macro
COMPARESLOTS
(obj1 obj2 &rest accessors)A handy macro for writing the bodies of `compare' methods for user classes. Returns the result of comparing the two objects by comparing the results of calling each of `accessors', in order, on the objects. Despite the name, an accessor can actually be any function on the class in question; it can also be a symbol, which will be used to access the slot via `slotvalue'. For example, if class `frob' has accessor `frobfoo' and slot `bar': (defmethod compare ((f1 frob) (f2 frob)) (compareslots f1 f2 #'frobfoo 'bar)) If the symbol `:eql' is supplied as the last accessor, then if the comparisons by the other supplied accessors all return `:equal' but `obj1' and `obj2' are not eql, this returns `:unequal'. 
Struct
COLLECTION
The root class of the FSet functional collections hierarchy. It is a structure class.No slots. 
Function
COLLECTION?
(object) 
Struct
SET
The abstract class for FSet functional sets. It is a structure class.No slots. 
Function
SET?
(object) 
Struct
BAG
The abstract class for FSet functional bags (multisets). It is a structure class.No slots. 
Function
BAG?
(object) 
Struct
MAP
The abstract class for FSet functional maps. It is a structure class.
DEFAULT


Function
MAP?
(object) 
Function
MAPDEFAULT
(instance) 
Function
(setf MAPDEFAULT)
(value instance) 
Struct
SEQ
The abstract class for FSet functional seqs (sequences, but we use the short name to avoid confusion with `cl:sequence'). It is a structure class.
DEFAULT


Function
SEQ?
(object) 
Struct
TUPLE
The abstract class for FSet functional tuples. It is a structure class.No slots. 
Function
TUPLE?
(object) 
Class
IDENTITYORDERINGMIXIN
A mixin class for classes whose instances will be used in FSet collections, and for which the appropriate equivalence relation is identity (`eq'). This is the right choice for the vast majority of mutable classes.
SERIALNUMBER
Accessor:SERIALNUMBER

NEXTSERIALNUMBER

NEXTSERIALNUMBERLOCK


Method
COMPARE
((obj1 identityorderingmixin) (obj2 identityorderingmixin)) 
Method
COMPARE
((a t) (b t)) 
Macro
DEFINECROSSTYPECOMPAREMETHODS
(type)Generates crosstype comparison methods for `type' against the types on which the macro has previously been invoked. This macro is intended to be invoked at the top level of a source file. You should make sure that calls to this macro are always compiled in the same order; if you don't, you could possibly get a "master type ordering out of sync" error, at which point you should delete all your fasls, restart your Lisp session, and recompile. However, the implementation tries very hard to prevent this. 
Method
COMPARE
((a null) (b null)) 
Method
COMPARE
((a real) (b real)) 
Method
COMPARE
((a character) (b character)) 
Method
COMPARE
((a symbol) (b symbol)) 
Method
COMPARE
((a string) (b string)) 
Method
COMPARE
((a vector) (b vector)) 
Method
COMPARE
((a list) (b list)) 
Method
COMPARE
((a package) (b package)) 
Method
COMPARE
((a pathname) (b pathname)) 
GenericFunction
COMPARELEXICOGRAPHICALLY
(a b)Returns the result of a lexicographic comparison of `a' and `b', which can be strings, vectors, lists, or seqs. 
Method
COMPARELEXICOGRAPHICALLY
((a string) (b string)) 
Method
COMPARELEXICOGRAPHICALLY
((a list) (b list)) 
Method
COMPARELEXICOGRAPHICALLY
((a vector) (b vector)) 
Method
COMPARE
(x (eqvs equivalentset))Returns `:less' or `:greater' if `x' is less than resp. greater than the values in `eqvs'; or EITHER `:equal' or `:unequal' if `x' is equivalent to any value in `eqvs'. 
Method
COMPARE
((eqvs equivalentset) x)Returns `:less' or `:greater' if the values in `eqvs' are less than resp. greater than `x'; or EITHER `:equal' or `:unequal' if `x' is equivalent to any value in `eqvs'. 
Method
COMPARE
((eqvs1 equivalentset) (eqvs2 equivalentset))Returns `:less' or `:greater' if the values in `eqvs1' are less than resp. greater than those in `eqvs2'; returns EITHER `:equal' or `:unequal' if those in `eqvs1' are equivalent to those in `eqvs2'. 
Method
COMPARE
(x (eqvs equivalentbag))Returns `:less' or `:greater' if `x' is less than resp. greater than the values in `eqvs'; or EITHER `:equal' or `:unequal' if `x' is equivalent to any value in `eqvs'. 
Method
COMPARE
((eqvs equivalentbag) x)Returns `:less' or `:greater' if the values in `eqvs' are less than resp. greater than `x'; or EITHER `:equal' or `:unequal' if `x' is equivalent to any value in `eqvs'. 
Method
COMPARE
((eqvs1 equivalentbag) (eqvs2 equivalentbag))Returns `:less' or `:greater' if the values in `eqvs1' are less than resp. greater than those in `eqvs2'; returns EITHER `:equal' or `:unequal' if those in `eqvs1' are equivalent to those in `eqvs2'. 
Method
COMPARE
(key (eqvm equivalentmap))Returns `:less' or `:greater' if `key' is less than resp. greater than the domain values in `eqvm'; or EITHER `:equal' or `:unequal' if `x' is equivalent to any domain value in `eqvm'. 
Method
COMPARE
((eqvm equivalentmap) key)Returns `:less' or `:greater' if the domain values in `eqvm' are less than resp. greater than `key'; or EITHER `:equal' or `:unequal' if `key' is equivalent to any domain value in `eqvm'. 
Method
COMPARE
((eqvm1 equivalentmap) (eqvm2 equivalentmap))Returns `:less' or `:greater' if the domain values in `eqvm1' are less than resp. greater than those in `eqvm2'; or EITHER `:equal' or `:unequal' if those in `eqvm1' are equivalent to those in `eqvm2'. 
GenericFunction
EMPTY?
(collection)Returns true iff the collection is empty. 
Function
NONEMPTY?
(collection)Returns true iff the collection is not empty. 
GenericFunction
SIZE
(collection)Returns the number of members in a set, seq, or bag, or the number of pairs in a map. The size of a bag is the sum of the multiplicities. 
GenericFunction
SETSIZE
(bag)Returns the number of unique members in the bag. 
GenericFunction
ARB
(collection)Returns an arbitrary member or pair of a set, bag, or map. Specifically, on a nonempty set, returns two values, an arbitrary member of the set and true; on a nonempty bag, returns an arbitrary member, its multiplicity, and true; on a nonempty map, returns an arbitrary domain member, its associated value, and true. On an empty set, bag, or map, returns false for all values. Please note that "arbitrary" does not mean "randomly selected"; it simply means that the sole postcondition is that the returned value or pair is a member of the collection. 
Function
MEMBER?
(x collection)Returns true iff `x' is a member of the set or bag. Stylistically, `contains?' is preferred over `member?'. 
GenericFunction
CONTAINS?
(collection x &optional y)Returns true iff the set or bag contains `x', or the map or relation contains the pair <x, y>. 
GenericFunction
DOMAINCONTAINS?
(collection x)Returns true iff the domain of the map or seq contains `x'. (The domain of a seq is the set of valid indices.) 
GenericFunction
RANGECONTAINS?
(collection x)Returns true iff the range of the map or seq contains `x'. (The range of a seq is the set of members.) Note that this requires a linear search. 
GenericFunction
MULTIPLICITY
(bag x)Returns the multiplicity of `x' in the bag. 
GenericFunction
LEAST
(collection)On a set, returns two values: the smallest member of the set and true; on a bag, returns three values: the smallest member of the bag, its multiplicity, and true; on a map, also returns three values: the smallest key of the map, its value, and true. If there is not a unique smallest member, chooses one of the smallest members arbitrarily. Returns `nil' if the collection is empty. 
GenericFunction
GREATEST
(collection)On a set, returns two values: the greatest member of the set and true; on a bag, returns three values: the greatest member of the bag, its multiplicity, and true; on a map, also returns three values: the greatest key of the map, its value, and true. If there is not a unique greatest member, chooses one of the greatest members arbitrarily. Returns `nil' if the collection is empty. 
GenericFunction
LOOKUP
(collection key)If `collection' is a map, returns the value to which `key' is mapped. If `collection' is a seq, takes `key' as an index and returns the corresponding member (0origin, of course). If `collection' is a set or bag that contains a member equal to `key', returns true and the member as two values, else false and `nil'; this is useful for canonicalization. 
GenericFunction
RANK
(collection value)If `collection' is a set or bag that contains `value', returns the rank of `value' in the ordering defined by `compare', and a true second value. If `collection' is a map whose domain contains `value', returns the rank of `value' in the domain of the map, and a true second value. If `value' is not in the collection, the second value is false, and the first value is the rank of the greatest member of the collection less than `value' (if any; otherwise 1). Note that if there are values/keys that are unequal but equivalent to `value', an arbitrary order will be imposed on them for this purpose; but another collection that is `equal?' but not `eq' to this one will in general order them differently. Also, on a bag, multiplicities are ignored for this purpose. 
GenericFunction
ATRANK
(collection rank)On a set, returns the element with rank `rank'; on a bag, returns that element with its multiplicity as a second value; on a map, returns the pair with that rank as two values. Note that if there are values/keys that are unequal but equivalent in the collection, an arbitrary order will be imposed on them for this purpose; but another collection that is `equal?' but not `eq' to this one will in general order them differently. 
Macro
@
(fnorcollection &rest args)A little hack with two purposes: (1) to make it easy to make FSet maps behave like Lisp functions in certain contexts; and (2) to somewhat lessen the pain of writing higherorder code in a twonamespace Lisp like Common Lisp. The idea is that you can write `(@ fn arg)', and if `fn' is a Lisp function, it will be funcalled on the argument; otherwise `lookup' (q.v.) will be called on `fn' and `arg'. To allow for `@' to be used in more contexts, it actually can take any number of `args', though `lookup' always takes exactly two. Thus you can write `(@ fn arg1 arg2 ...)' when you just want a shorter name for `funcall'. As a matter of style, it is suggested that `@' be used only for sideeffectfree functions. Also, though this doc string has spoken only of FSet maps, `@' can be used with any type that `lookup' works on. Can be used with `setf', but only on collections, not functions, of course. 
GenericFunction
WITH
(collection value1 &optional value2)On a set, adds `value1' to it, returning the updated set. On a bag, adds `value2' occurrences of `value1', returning the updated bag; `value2' defaults to 1. On a map, adds a mapping from `value1' (the key) to `value2', returning the updated map. On a seq, replaces the element at index `value1' with `value2', returning the updated seq (the seq is extended in either direction if needed; previously uninitialized indices are filled with the seq's default). 
GenericFunction
LESS
(collection value1 &optional value2)On a set, removes `value1' from it if present, returning the updated set. On a bag, removes `value2' occurrences of `value1' if present, returning the updated bag; `value2' defaults to 1. On a map, removes the pair whose key is `value1', if present, returning the updated map. On a seq, removes the element at index `value1', if that index is in bounds, and shifts subsequent elements down, returning the updated seq. 
GenericFunction
UNION
(setorbag1 setorbag2 &key)Returns the union of the two sets/bags. The result is a set if both arguments are sets; otherwise a bag. The union of two bags is a bag whose multiplicity, for any value, is the maximum of its multiplicities in the two argument bags. 
GenericFunction
BAGSUM
(bag1 bag2)Returns a bag whose multiplicity, for any value, is the sum of its multiplicities in the two argument bags. 
GenericFunction
INTERSECTION
(setorbag1 setorbag2 &key)Returns the intersection of the two sets/bags. The result is a bag if both arguments are bags; otherwise a set. The intersection of two bags is the bag whose multiplicity, for any value, is the minimum of its multiplicities in the two argument bags. 
GenericFunction
BAGPRODUCT
(bag1 bag2)Returns a bag whose multiplicity, for any value, is the product of its multiplicities in the two argument bags. 
GenericFunction
SETDIFFERENCE
(set1 set2 &key)Returns the set difference of set1 and set2, i.e., the set containing every member of `set1' that is not in `set2'. 
GenericFunction
SETDIFFERENCE2
(set1 set2)Returns `set1  set2' and `set2  set1' as two values. 
GenericFunction
BAGDIFFERENCE
(bag1 bag2)Returns a bag whose multiplicity, for any value, is its multiplicity in `bag1' less that in `bag2', but of course not less than zero. 
GenericFunction
SUBSET?
(sub super)Returns true iff `sub' is a subset of `super'. 
GenericFunction
DISJOINT?
(set1 set2)Returns true iff `set1' and `set2' have a null intersection (without actually constructing said intersection). 
GenericFunction
SUBBAG?
(sub super)Returns true iff `sub' is a subbag of `super', that is, for every member of `sub', `super' contains the same value with at least the same multiplicity. 
GenericFunction
FILTER
(fn collection)Returns a new collection containing those members or pairs of `collection' for which `fn' returns true. If `collection' is a set, bag, or seq, `fn' is called with one argument; if a map, `fn' is called with two arguments, the key and the value (the mapdefault of the result is that of `collection'). As well as a Lisp function, `fn' can be a map, or a set (which is treated as mapping its members to true and everything else to false). 
GenericFunction
PARTITION
(pred collection)Returns two values, (filter fn collection) and (filter (cl:complement fn) collection). 
GenericFunction
FILTERPAIRS
(fn collection)Just like `filter' except that if invoked on a bag, `fn' (which must be a Lisp function) is called with two arguments for each pair, the member and the multiplicity. 
Method
FILTERPAIRS
(fn (collection t)) 
GenericFunction
IMAGE
(fn collection)Returns a new collection containing the result of applying `fn' to each member of `collection', which may be a set, bag, or seq. In the bag case, the multiplicity of each member of the result is the sum of the multiplicities of the values that `fn' maps to it. As well as a Lisp function, `fn' can be a map, or a set (which is treated as mapping its members to true and everything else to false). `collection' can also be a map, in which case `fn' must be a Lisp function of two arguments that returns two values (the mapdefault of the result is that of `collection'); also see `compose'. 
Method
IMAGE
((fn function) (l list)) 
Method
IMAGE
((fn symbol) (l list)) 
Method
IMAGE
((fn map) (l list)) 
Method
IMAGE
((fn set) (l list)) 
GenericFunction
REDUCE
(fn collection &key key initialvalue)If `collection' is a Lisp sequence, this simply calls `cl:reduce' (q.v.). On an FSet collection, the `:start', `:end', and `:fromend' keywords are accepted only if `collection' is a seq. 
Method
REDUCE
(fn (s sequence) &rest keywordargs &key key initialvalue start end fromend) 
GenericFunction
DOMAIN
(map)Returns the domain of the map, that is, the set of keys mapped by the map. 
GenericFunction
RANGE
(map)Returns the range of the map, that is, the set of all values to which keys are mapped by the map. 
GenericFunction
WITHDEFAULT
(collection newdefault)Returns a new map or seq with the same contents as `collection' but whose default is now `newdefault'. 
GenericFunction
MAPUNION
(map1 map2 &optional valfn)Returns a map containing all the keys of `map1' and `map2', where the value for each key contained in only one map is the value from that map, and the value for each key contained in both maps is the result of calling `valfn' on the value from `map1' and the value from `map2'. `valfn' defaults to simply returning its second argument, so the entries in `map2' simply shadow those in `map1'. The default for the new map is the result of calling `valfn' on the defaults for the two maps (so be sure it can take these values). 
GenericFunction
MAPINTERSECTION
(map1 map2 &optional valfn)Returns a map containing all the keys that are in the domains of both `map1' and `map2', where the value for each key is the result of calling `valfn' on the value from `map1' and the value from `map2'. `valfn' defaults to simply returning its second argument, so the entries in `map2' simply shadow those in `map1'. The default for the new map is the result of calling `valfn' on the defaults for the two maps (so be sure it can take these values). 
GenericFunction
MAPDIFFERENCE2
(map1 map2)Returns, as two values: a map containing all the pairs that are in `map1' but not `map2', with the same default as `map1'; and one containing all the pairs that are in `map2' but not `map1', with the same default as `map2'. 
GenericFunction
RESTRICT
(map set)Returns a map containing only those pairs of `map' whose keys are also in `set'. 
GenericFunction
RESTRICTNOT
(map set)Returns a map containing only those pairs of `map' whose keys are not in `set'. 
GenericFunction
COMPOSE
(map1 map2orfn)Returns a new map with the same domain as `map1', which maps each member of that domain to the result of applying first `map1' to it, then applying `map2orfn' to the result. `map2orfn' can also be a sequence, which is treated as a map from indices to members. 
GenericFunction
FIRST
(seq)Returns the first element of `seq', i.e., element 0. This has a back compatibility method for lists, and adds one for CL sequences generally. 
Method
FIRST
((s list)) 
Method
FIRST
((s sequence)) 
GenericFunction
LAST
(seq)Returns the last element of `seq', i.e., element `(1 (size seq))'. This has methods for CL lists and sequences that are NOT COMPATIBLE with `cl:last'. FSet exports `lastcons' as an arguably better name for the functionality of `cl:last'. 
Method
LAST
((s list)) 
Method
LAST
((s sequence)) 
GenericFunction
WITHFIRST
(seq val)Returns `seq' with `val' prepended, that is, `val' is element 0 of the result, and the elements of `seq' appear starting at index 1. 
GenericFunction
WITHLAST
(seq val)Returns `seq' with `val' appended, that is, `val' is element `(size seq)' of the result. 
GenericFunction
LESSFIRST
(seq)Returns the subsequence of `seq' from element 1 through the end. 
GenericFunction
LESSLAST
(seq)Returns the subsequence of `seq' from element 0 through the nexttolast element. 
GenericFunction
INSERT
(seq idx val)Returns a new sequence like `seq' but with `val' inserted at `idx' (the seq is extended in either direction if needed prior to the insertion; previously uninitialized indices are filled with the seq's default). 
GenericFunction
SPLICE
(seq idx subseq)Returns a new sequence like `seq' but with the elements of `subseq' inserted at `idx' (the seq is extended in either direction if needed prior to the insertion; previously uninitialized indices are filled with the seq's default). 
GenericFunction
CONCAT
(seq1 &rest seqs)Returns the concatenation of `seq1' with each of `seqs'. 
GenericFunction
CONVERT
(totype collection &key)Converts the collection to the specified type. Some methods may take additional keyword arguments to further specify the kind of conversion. 
GenericFunction
ITERATOR
(collection &key)Returns an iterator for the collection. (These are stateful iterators and are not threadsafe; if you want a pure iterator, your best bet is to `convert' the collection to a list.) The iterator is a closure of one argument; given `:done?', it returns true iff the iterator is exhausted; given `:more?', it returns true iff the iterator is _not_ exhausted. Given `:get', if the iterator is not exhausted, it returns the next element (or pair, for a map, as two values), with the second value (third, for a map) being true, and advances one element; if it is exhausted, it returns two `nil' values (three, for a map). 
Method
ITERATOR
((ls list) &key) 
Method
ITERATOR
((vec vector) &key) 
Method
ITERATOR
((str string) &key) 
Method
ITERATOR
((seq sequence) &key) 
GenericFunction
SUBSEQ
(seq start &optional end)Returns the subsequence of `seq' from `start' (inclusive) to `end' (exclusive), where `end' defaults to `(size seq)'. 
Method
SUBSEQ
((s sequence) start &optional end) 
GenericFunction
REVERSE
(seq)Returns `seq' in reverse order. 
Method
REVERSE
((s sequence)) 
GenericFunction
SORT
(seq pred &key key)Returns `seq' sorted by `pred', a function of two arguments; if `key' is supplied, it is a function of one argument that is applied to the elements of `seq' before they are passed to `pred'. The sort is not guaranteed to be stable. The method for CL sequences copies the sequence first, unlike `cl:sort'. 
Method
SORT
((s sequence) pred &key key) 
GenericFunction
STABLESORT
(seq pred &key key)Returns `seq' sorted by `pred', a function of two arguments; if `key' is supplied, it is a function of one argument that is applied to the elements of `seq' before they are passed to `pred'. The sort is guaranteed to be stable. The method for CL sequences copies the sequence first, unlike `cl:stablesort'. 
Method
STABLESORT
((s sequence) pred &key key) 
GenericFunction
FIND
(item collection &key key test)If `collection' is a Lisp sequence, this simply calls `cl:find'. On an FSet collection, the default for `test' is `equal?'; the `:testnot' keyword is not accepted; and the `:start', `:end', and `:fromend' keywords are accepted only if `collection' is a seq. Also, on a map, this scans the domain; on success, it returns the corresponding range element as the second value. 
Method
FIND
(item (s sequence) &rest keywordargs &key key test testnot start end fromend) 
GenericFunction
FINDIF
(pred collection &key key)If `collection' is a Lisp sequence, this simply calls `cl:findif'. On an FSet collection, the `:start', `:end', and `:fromend' keywords are accepted only if `collection' is a seq. Also, on a map, this scans the domain; on success, it returns the corresponding range element as the second value. 
Method
FINDIF
(pred (s sequence) &rest keywordargs &key key start end fromend) 
GenericFunction
FINDIFNOT
(pred collection &key key)If `collection' is a Lisp sequence, this simply calls `cl:findifnot'. On an FSet collection, the `:start', `:end', and `:fromend' keywords are accepted only if `collection' is a seq. Also, on a map, this scans the domain; on success, it returns the corresponding range element as the second value. 
Method
FINDIFNOT
(pred (s sequence) &rest keywordargs &key key start end fromend) 
GenericFunction
COUNT
(item collection &key key test)If `collection' is a Lisp sequence, this simply calls `cl:count'. On an FSet collection, the default for `test' is `equal?'; the `:testnot' keyword is not accepted; and the `:start', `:end', and `:fromend' keywords are accepted only if `collection' is a seq. Also, on a map, this scans the domain. 
Method
COUNT
(item (s sequence) &rest keywordargs &key key test testnot start end fromend) 
GenericFunction
COUNTIF
(pred collection &key key)If `collection' is a Lisp sequence, this simply calls `cl:countif'. On an FSet collection, the `:start', `:end', and `:fromend' keywords are accepted only if `collection' is a seq. Also, on a map, this scans the domain. 
Method
COUNTIF
(pred (s sequence) &rest keywordargs &key key start end fromend) 
GenericFunction
COUNTIFNOT
(pred collection &key key)If `collection' is a Lisp sequence, this simply calls `cl:countifnot'. On an FSet collection, the `:start', `:end', and `:fromend' keywords are accepted only if `collection' is a seq. Also, on a map, this scans the domain. 
Method
COUNTIFNOT
(pred (s sequence) &rest keywordargs &key key start end fromend) 
GenericFunction
POSITION
(item collection &key key test start end fromend)If `collection' is a Lisp sequence, this simply calls `cl:position'. On an FSet seq, the default for `test' is `equal?', and the `:testnot' keyword is not accepted. 
Method
POSITION
(item (s sequence) &rest keywordargs &key key test testnot start end fromend) 
GenericFunction
POSITIONIF
(pred collection &key key start end fromend)If `collection' is a Lisp sequence, this simply calls `cl:positionif'. Also works on an FSet seq. 
Method
POSITIONIF
(pred (s sequence) &rest keywordargs &key key start end fromend) 
GenericFunction
POSITIONIFNOT
(pred collection &key key start end fromend)If `collection' is a Lisp sequence, this simply calls `cl:positionifnot'. Also works on an FSet seq. 
Method
POSITIONIFNOT
(pred (s sequence) &rest keywordargs &key key start end fromend) 
GenericFunction
REMOVE
(item collection &key key test)If `collection' is a Lisp sequence, this simply calls `cl:remove'. On an FSet seq, the default for `test' is `equal?', and the `:testnot' keyword is not accepted. 
Method
REMOVE
(item (s sequence) &rest keywordargs &key key test start end fromend count) 
GenericFunction
REMOVEIF
(pred collection &key key)If `collection' is a Lisp sequence, this simply calls `cl:removeif'. Also works on an FSet seq; but see `filter'. 
Method
REMOVEIF
(pred (s sequence) &rest keywordargs &key key start end fromend count) 
GenericFunction
REMOVEIFNOT
(pred collection &key key)If `collection' is a Lisp sequence, this simply calls `cl:removeifnot'. Also works on an FSet seq; but see `filter'. 
Method
REMOVEIFNOT
(pred (s sequence) &rest keywordargs &key key start end fromend count) 
GenericFunction
SUBSTITUTE
(newitem olditem collection &key key)If `collection' is a Lisp sequence, this simply calls `cl:substitute'. On an FSet seq, the default for `test' is `equal?', and the `:testnot' keyword is not accepted. 
Method
SUBSTITUTE
(newitem olditem (s sequence) &rest keywordargs &key key test start end fromend count) 
GenericFunction
SUBSTITUTEIF
(newitem pred collection &key key)If `collection' is a Lisp sequence, this simply calls `cl:substituteif'. Also works on an FSet seq. 
Method
SUBSTITUTEIF
(newitem pred (s sequence) &rest keywordargs &key key start end fromend count) 
GenericFunction
SUBSTITUTEIFNOT
(newitem pred collection &key key)If `collection' is a Lisp sequence, this simply calls `cl:substituteifnot'. Also works on an FSet seq. 
Method
SUBSTITUTEIFNOT
(newitem pred (s sequence) &rest keywordargs &key key start end fromend count) 
Method
UNION
((ls1 list) (ls2 list) &rest keywordargs &key test testnot) 
Method
INTERSECTION
((ls1 list) (ls2 list) &rest keywordargs &key test testnot) 
Method
SETDIFFERENCE
((ls1 list) (ls2 list) &rest keywordargs &key test testnot) 
Method
CONCAT
((a list) &rest seqs) 
Method
PARTITION
((pred symbol) (ls list)) 
Method
PARTITION
((pred function) (ls list)) 
Function
LASTCONS
(list)Returns the last cons of `list'. This is a renaming of the CL function `last'. 
Function
HEAD
(list)Another name for the `car' operation on lists. 
Function
TAIL
(list)Another name for the `cdr' operation on lists. 
Macro
ADJOINF
(place &rest itemortuple &environment env)(adjoinf coll . args) > (setf coll (with coll . args)) 
Macro
REMOVEF
(place &rest itemortuple &environment env)(removef coll . args) > (setf coll (less coll . args)) 
Macro
INCLUDEF
(place &rest itemortuple &environment env)(includef coll . args) > (setf coll (with coll . args)) 
Macro
EXCLUDEF
(place &rest itemortuple &environment env)(excludef coll . args) > (setf coll (less coll . args)) 
Macro
UNIONF
(place set &environment env) 
Macro
INTERSECTF
(place set &environment env) 
Macro
IMAGEF
(place fn &environment env) 
Macro
COMPOSEF
(place fn &environment env) 
Macro
PUSHFIRST
(place val &environment env)(pushfirst seq val) > (setf seq (withfirst seq val)) 
Macro
PUSHLAST
(place val &environment env)(pushlast seq val) > (setf seq (withlast seq val)) 
Macro
POPFIRST
(seq &environment env)Removes the first element from `seq' and returns it. 
Macro
POPLAST
(seq &environment env)Removes the last element from `seq' and returns it. 
Macro
APPENDF
(place seq &environment env) 
Macro
PREPENDF
(place seq &environment env) 
Struct
WBSET
A class of functional sets represented as weightbalanced binary trees. This is the default implementation of sets in FSet.
CONTENTS


Function
EMPTYSET
Returns an empty set of the default implementation. 
Function
EMPTYWBSET
Returns an empty wbset. 
Method
EMPTY?
((s wbset)) 
Method
SIZE
((s wbset)) 
Method
SETSIZE
((s wbset)) 
Method
ARB
((s wbset)) 
Method
CONTAINS?
((s wbset) x &optional (y nil y?)) 
Method
LOOKUP
((s wbset) key) 
Method
RANK
((s wbset) x) 
Method
ATRANK
((s wbset) rank) 
Method
LEAST
((s wbset)) 
Method
GREATEST
((s wbset)) 
Method
WITH
((s wbset) value &optional (arg2 nil arg2?)) 
Method
LESS
((s wbset) value &optional (arg2 nil arg2?)) 
Method
SPLITFROM
((s wbset) value) 
Method
SPLITABOVE
((s wbset) value) 
Method
SPLITTHROUGH
((s wbset) value) 
Method
SPLITBELOW
((s wbset) value) 
Method
UNION
((s1 wbset) (s2 wbset) &key) 
Method
INTERSECTION
((s1 wbset) (s2 wbset) &key) 
Method
SETDIFFERENCE
((s1 wbset) (s2 wbset) &key) 
Method
SETDIFFERENCE2
((s1 wbset) (s2 wbset)) 
Method
SUBSET?
((s1 wbset) (s2 wbset)) 
Method
DISJOINT?
((s1 wbset) (s2 wbset)) 
Method
COMPARE
((s1 wbset) (s2 wbset)) 
Macro
DOSET
((var set &optional value) &body body)For each member of `set', binds `var' to it and executes `body'. When done, returns `value'. 
Method
ITERATOR
((s wbset) &key) 
Method
FILTER
((pred function) (s set)) 
Method
FILTER
((pred symbol) (s set)) 
Method
FILTER
((pred map) (s set)) 
Method
PARTITION
((pred function) (s set)) 
Method
PARTITION
((pred symbol) (s set)) 
Method
PARTITION
((pred map) (s set)) 
Method
FILTER
((pred set) (s set)) 
Method
FILTER
((pred bag) (s set)) 
Method
IMAGE
((fn function) (s set)) 
Method
IMAGE
((fn symbol) (s set)) 
Method
IMAGE
((fn map) (s set)) 
Method
IMAGE
((fn set) (s set)) 
Method
IMAGE
((fn bag) (s set)) 
Method
REDUCE
((fn function) (s set) &key key (initialvalue nil init?)) 
Method
REDUCE
((fn symbol) (s set) &key key (initialvalue nil init?)) 
Method
SORT
((s set) pred &key key) 
Method
STABLESORT
((s set) pred &key key) 
Method
CONVERT
((totype (eql 'bag)) (s wbset) &key) 
Method
CONVERT
((totype (eql 'wbbag)) (s wbset) &key) 
Method
CONVERT
((totype (eql 'list)) (s set) &key) 
Method
CONVERT
((totype (eql 'vector)) (s set) &key) 
Method
CONVERT
((totype (eql 'set)) (l list) &key) 
Method
CONVERT
((totype (eql 'wbset)) (l list) &key) 
Method
CONVERT
((totype (eql 'set)) (s sequence) &key) 
Method
CONVERT
((totype (eql 'wbset)) (s sequence) &key) 
Method
FIND
(item (s set) &key key test) 
Method
FINDIF
(pred (s set) &key key) 
Method
FINDIFNOT
(pred (s set) &key key) 
Method
COUNT
(item (s set) &key key test) 
Method
COUNTIF
(pred (s set) &key key) 
Method
COUNTIFNOT
(pred (s set) &key key) 
Struct
WBBAG
A class of functional bags (multisets) represented as weightbalanced binary trees. This is the default implementation of bags in FSet.
CONTENTS


Function
EMPTYBAG
Returns an empty bag of the default implementation. 
Function
EMPTYWBBAG
Returns an empty wbbag. 
Method
EMPTY?
((b wbbag)) 
Method
ARB
((m wbbag)) 
Method
CONTAINS?
((b wbbag) x &optional (y nil y?)) 
Method
LOOKUP
((b wbbag) x) 
Method
RANK
((s wbbag) x) 
Method
ATRANK
((s wbbag) rank) 
Method
LEAST
((b wbbag)) 
Method
GREATEST
((m wbbag)) 
Method
SIZE
((b wbbag)) 
Method
SETSIZE
((b wbbag)) 
Method
MULTIPLICITY
((b wbbag) x) 
Method
MULTIPLICITY
((s set) x) 
Method
WITH
((b wbbag) value &optional (multiplicity 1)) 
Method
LESS
((b wbbag) value &optional (multiplicity 1)) 
Method
UNION
((b1 wbbag) (b2 wbbag) &key) 
Method
UNION
((s wbset) (b wbbag) &key) 
Method
UNION
((b wbbag) (s wbset) &key) 
Method
BAGSUM
((b1 wbbag) (b2 wbbag)) 
Method
BAGSUM
((s wbset) (b wbbag)) 
Method
BAGSUM
((b wbbag) (s wbset)) 
Method
INTERSECTION
((s1 wbbag) (s2 wbbag) &key) 
Method
INTERSECTION
((s wbset) (b wbbag) &key) 
Method
INTERSECTION
((b wbbag) (s wbset) &key) 
Method
BAGPRODUCT
((b1 wbbag) (b2 wbbag)) 
Method
BAGPRODUCT
((s wbset) (b wbbag)) 
Method
BAGPRODUCT
((b wbbag) (s wbset)) 
Method
BAGDIFFERENCE
((b1 wbbag) (b2 wbbag)) 
Method
BAGDIFFERENCE
((s wbset) (b wbbag)) 
Method
BAGDIFFERENCE
((b wbbag) (s wbset)) 
Method
SUBBAG?
((b1 wbbag) (b2 wbbag)) 
Method
SUBBAG?
((s wbset) (b wbbag)) 
Method
SUBBAG?
((b wbbag) (s wbset)) 
Method
COMPARE
((b1 wbbag) (b2 wbbag)) 
Macro
DOBAGPAIRS
((valuevar multvar bag &optional value) &body body)For each member of `bag', binds `valuevar' and `multvar' to the member and its multiplicity respectively, and executes `body'. When done, returns `value'. 
Macro
DOBAG
((valuevar bag &optional value) &body body)For each member of `bag', binds `valuevar' to it and and executes `body' a number of times equal to the member's multiplicity. When done, returns `value'. 
Method
ITERATOR
((b wbbag) &key pairs?) 
Method
FILTER
((pred function) (b bag)) 
Method
FILTER
((pred symbol) (b bag)) 
Method
FILTER
((pred map) (b bag)) 
Method
FILTER
((pred set) (b bag)) 
Method
FILTER
((pred bag) (b bag)) 
Method
FILTERPAIRS
((pred function) (b bag)) 
Method
FILTERPAIRS
((pred symbol) (b bag)) 
Method
IMAGE
((fn function) (b bag)) 
Method
IMAGE
((fn symbol) (b bag)) 
Method
IMAGE
((fn map) (b bag)) 
Method
IMAGE
((fn set) (b bag)) 
Method
IMAGE
((fn bag) (b bag)) 
Method
REDUCE
((fn function) (b bag) &key key (initialvalue nil init?)) 
Method
REDUCE
((fn symbol) (b bag) &key key (initialvalue nil init?)) 
Method
CONVERT
((totype (eql 'set)) (b wbbag) &key) 
Method
CONVERT
((totype (eql 'wbset)) (b wbbag) &key) 
Method
CONVERT
((totype (eql 'list)) (b bag) &key) 
Method
CONVERT
((totype (eql 'seq)) (b bag) &key) 
Method
CONVERT
((totype (eql 'vector)) (b bag) &key) 
Method
CONVERT
((totype (eql 'alist)) (b bag) &key) 
Method
CONVERT
((totype (eql 'bag)) (l list) &key fromtype)If `fromtype' is the symbol `alist', treats the operand as an alist where the cdr of each pair (which must be a positive integer) is the member count for the car. Otherwise the operand is treated as a simple list of members, some of which may be repeated. 
Method
CONVERT
((totype (eql 'wbbag)) (l list) &key fromtype)If `fromtype' is the symbol `alist', treats the operand as an alist where the cdr of each pair (which must be a positive integer) is the member count for the car. Otherwise the operand is treated as a simple list of members, some of which may be repeated. 
Method
CONVERT
((totype (eql 'bag)) (s sequence) &key) 
Method
CONVERT
((totype (eql 'wbbag)) (s sequence) &key) 
Method
FIND
(item (b bag) &key key test) 
Method
FINDIF
(pred (b bag) &key key) 
Method
FINDIFNOT
(pred (b bag) &key key) 
Method
COUNT
(item (b bag) &key key test) 
Method
COUNTIF
(pred (b bag) &key key) 
Method
COUNTIFNOT
(pred (s bag) &key key) 
Struct
WBMAP
A class of functional maps represented as weightbalanced binary trees. This is the default implementation of maps in FSet.
CONTENTS


Function
EMPTYMAP
(&optional default)Returns an empty map of the default implementation. 
Function
EMPTYWBMAP
(&optional default)Returns an empty wbmap. 
Method
WITHDEFAULT
((m wbmap) newdefault) 
Method
EMPTY?
((m wbmap)) 
Method
ARB
((m wbmap)) 
Method
LEAST
((m wbmap)) 
Method
GREATEST
((m wbmap)) 
Method
SIZE
((m wbmap)) 
Method
CONTAINS?
((m wbmap) x &optional (y nil y?)) 
Method
LOOKUP
((m wbmap) key) 
Method
RANK
((s wbmap) x) 
Method
ATRANK
((s wbmap) rank) 
Method
WITH
((m wbmap) key &optional (value nil value?)) 
Method
LESS
((m wbmap) key &optional (arg2 nil arg2?)) 
Method
DOMAIN
((m wbmap)) 
Method
COMPARE
((map1 wbmap) (map2 wbmap)) 
Macro
DOMAP
((keyvar valuevar map &optional value) &body body)For each pair of `map', binds `keyvar' and `valuevar' and executes `body'. When done, returns `value'. 
Macro
DOMAPDOMAIN
((keyvar map &optional value) &body body)For each pair of `map', binds `keyvar' and executes `body'. When done, returns `value'. 
Method
ITERATOR
((m wbmap) &key) 
Method
FILTER
((pred function) (m map)) 
Method
FILTER
((pred symbol) (m map)) 
Method
IMAGE
((fn function) (m map)) 
Method
IMAGE
((fn symbol) (m map)) 
Method
REDUCE
((fn function) (m map) &key key (initialvalue nil init?)) 
Method
REDUCE
((fn symbol) (m map) &key key (initialvalue nil init?)) 
Method
RANGE
((m map)) 
Method
DOMAINCONTAINS?
((m wbmap) x) 
Method
RANGECONTAINS?
((m wbmap) x) 
Method
MAPUNION
((map1 wbmap) (map2 wbmap) &optional (valfn #'(lambda (v1 v2) (declare (ignore v1)) v2))) 
Method
MAPINTERSECTION
((map1 wbmap) (map2 wbmap) &optional (valfn #'(lambda (v1 v2) (declare (ignore v1)) v2))) 
Method
MAPDIFFERENCE2
((map1 wbmap) (map2 wbmap)) 
Method
RESTRICT
((m wbmap) (s wbset)) 
Method
RESTRICTNOT
((m wbmap) (s wbset)) 
Method
COMPOSE
((map1 map) (map2 wbmap)) 
Method
COMPOSE
((m wbmap) (fn function)) 
Method
COMPOSE
((m wbmap) (fn symbol)) 
Method
COMPOSE
((m wbmap) (s seq)) 
Method
CONVERT
((totype (eql 'list)) (m map) &key (pairfn #'cons)) 
Method
CONVERT
((totype (eql 'seq)) (m map) &key (pairfn #'cons)) 
Method
CONVERT
((totype (eql 'vector)) (m map) &key (pairfn #'cons)) 
Method
CONVERT
((totype (eql 'set)) (m map) &key (pairfn #'cons)) 
Method
CONVERT
((totype (eql 'map)) (list list) &key (keyfn #'car) (valuefn #'cdr)) 
Method
CONVERT
((totype (eql 'wbmap)) (list list) &key (keyfn #'car) (valuefn #'cdr)) 
Method
CONVERT
((totype (eql 'map)) (s sequence) &key (keyfn #'car) (valuefn #'cdr)) 
Method
CONVERT
((totype (eql 'wbmap)) (s sequence) &key (keyfn #'car) (valuefn #'cdr)) 
Method
CONVERT
((totype (eql 'map)) (b bag) &key) 
Method
CONVERT
((totype (eql 'wbmap)) (b bag) &key) 
Method
CONVERT
((totype (eql 'map)) (ht hashtable) &key) 
Method
CONVERT
((totype (eql 'wbmap)) (ht hashtable) &key) 
Method
CONVERT
((totype (eql 'hashtable)) (m map) &rest makehashtableargs &key &allowotherkeys) 
Method
FIND
(item (m map) &key key test) 
Method
FINDIF
(pred (m map) &key key) 
Method
FINDIFNOT
(pred (m map) &key key) 
Method
COUNT
(item (m map) &key key test) 
Method
COUNTIF
(pred (m map) &key key) 
Method
COUNTIFNOT
(pred (m map) &key key) 
Struct
WBSEQ
A class of functional seqs (sequences, but we use the short name to avoid confusion with `cl:sequence') represented as weightbalanced binary trees. This is the default implementation of seqs in FSet.
CONTENTS


Function
EMPTYSEQ
(&optional default)Returns an empty seq of the default implementation. 
Function
EMPTYWBSEQ
Returns an empty wbseq. 
Method
EMPTY?
((s wbseq)) 
Method
WITHDEFAULT
((s wbseq) newdefault) 
Method
SIZE
((s wbseq)) 
Method
LOOKUP
((s wbseq) key) 
Method
FIRST
((s wbseq)) 
Method
LAST
((s wbseq)) 
Method
WITHFIRST
((s wbseq) val) 
Method
WITHLAST
((s wbseq) val) 
Method
LESSFIRST
((s wbseq)) 
Method
LESSLAST
((s wbseq)) 
Method
WITH
((s wbseq) idx &optional (val nil val?)) 
Method
INSERT
((s wbseq) idx val) 
Method
SPLICE
((s wbseq) idx subseq) 
Method
LESS
((s wbseq) idx &optional (arg2 nil arg2?)) 
Method
CONCAT
((s1 seq) &rest seqs) 
Method
SUBSEQ
((s wbseq) start &optional end) 
Method
REVERSE
((s wbseq)) 
Method
SORT
((s wbseq) pred &key key) 
Method
STABLESORT
((s wbseq) pred &key key) 
Method
DOMAIN
((s wbseq)) 
Method
RANGE
((s wbseq)) 
Method
CONVERT
((totype (eql 'seq)) (vec vector) &key) 
Method
CONVERT
((totype (eql 'wbseq)) (vec vector) &key) 
Method
CONVERT
((totype (eql 'vector)) (s wbseq) &key) 
Method
CONVERT
((totype (eql 'string)) (s wbseq) &key) 
Method
CONVERT
((totype (eql 'seq)) (l list) &key) 
Method
CONVERT
((totype (eql 'wbseq)) (l list) &key) 
Method
CONVERT
((totype (eql 'list)) (s wbseq) &key) 
Method
CONVERT
((totype (eql 'seq)) (s set) &key) 
Method
CONVERT
((totype (eql 'wbseq)) (s set) &key) 
Method
CONVERT
((totype (eql 'set)) (s wbseq) &key) 
Method
CONVERT
((totype (eql 'wbset)) (s wbseq) &key) 
Method
CONVERT
((totype (eql 'wbseq)) (b bag) &key) 
Method
CONVERT
((totype (eql 'wbseq)) (m map) &key (pairfn #'cons)) 
Method
COMPARE
((s1 wbseq) (s2 wbseq)) 
Method
COMPARELEXICOGRAPHICALLY
((s1 wbseq) (s2 wbseq)) 
Macro
DOSEQ
((var seq &key (start nil start?) (end nil end?) (fromend? nil fromend??) (index nil index?) (value nil)) &body body)For each element of `seq', possibly restricted by `start' and `end', and in reverse order if `fromend?' is true, binds `var' to it and executes `body'. If `index' is supplied, it names a variable that will be bound at each iteration to the index of the current element of `seq'. When done, returns `value'. 
Method
ITERATOR
((s wbseq) &key) 
Method
DOMAINCONTAINS?
((s seq) x) 
Method
RANGECONTAINS?
((s seq) x) 
Method
FILTER
((fn function) (s seq)) 
Method
FILTER
((fn symbol) (s seq)) 
Method
FILTER
((fn map) (s seq)) 
Method
FILTER
((fn set) (s seq)) 
Method
FILTER
((fn bag) (s seq)) 
Method
PARTITION
((fn function) (s seq)) 
Method
PARTITION
((fn symbol) (s seq)) 
Method
PARTITION
((fn map) (s seq)) 
Method
PARTITION
((fn set) (s seq)) 
Method
PARTITION
((fn bag) (s seq)) 
Method
IMAGE
((fn function) (s seq)) 
Method
IMAGE
((fn symbol) (s seq)) 
Method
IMAGE
((fn map) (s seq)) 
Method
IMAGE
((fn set) (s seq)) 
Method
IMAGE
((fn bag) (s seq)) 
Method
REDUCE
((fn function) (s seq) &key key (initialvalue nil init?) (start 0) (end (size s)) (fromend nil)) 
Method
REDUCE
((fn symbol) (s seq) &key key (initialvalue nil init?) (start 0) (end (size s)) (fromend nil)) 
Method
FIND
(item (s seq) &key key test start end fromend) 
Method
FINDIF
(pred (s seq) &key key start end fromend) 
Method
FINDIFNOT
(pred (s seq) &key key start end fromend) 
Method
COUNT
(item (s seq) &key key test start end fromend) 
Method
COUNTIF
(pred (s seq) &key key start end fromend) 
Method
COUNTIFNOT
(pred (s seq) &key key start end fromend) 
Method
POSITION
(item (s seq) &key key test start end fromend) 
Method
POSITIONIF
(pred (s seq) &key key start end fromend) 
Method
POSITIONIFNOT
(pred (s seq) &key key start end fromend) 
Method
REMOVE
(item (s seq) &key key test start end fromend count) 
Method
REMOVEIF
(pred (s seq) &key key start end fromend count) 
Method
REMOVEIFNOT
(pred (s seq) &key key start end fromend count) 
Method
SUBSTITUTE
(newitem olditem (s seq) &key key test start end fromend count) 
Method
SUBSTITUTEIF
(newitem pred (s seq) &key key start end fromend count) 
Method
SUBSTITUTEIFNOT
(newitem pred (s seq) &key key start end fromend count) 
Method
EMPTY?
((l list)) 
Method
EMPTY?
((s sequence)) 
Method
SIZE
((s sequence)) 
Method
LOOKUP
((s sequence) (idx integer)) 
Struct
DYNTUPLE
A class of functional tuples represented as vectors with dynamically reordered key vectors. This is the default implementation of tuples in FSet.
DESCRIPTOR

CONTENTS


Function
TUPLEKEY?
(object) 
Function
TUPLEKEYNAME
(instance) 
Function
(setf TUPLEKEYNAME)
(value instance) 
Function
GETTUPLEKEY
(name &optional defaultfn)Finds or creates a tuple key named `name'. If the key did not already exist, and `defaultfn' is supplied, it is used to compute a value for lookups where the tuple has no explicit pair with this key; it is called with one argument, the tuple. 
Macro
DEFTUPLEKEY
(name &optional defaultfn)Deprecated; use `definetuplekey'. 
Macro
DEFINETUPLEKEY
(name &optional defaultfn)Defines a tuple key named `name' as a global lexical variable (see `deflex'). If `defaultfn' is supplied, it is used to compute a value for lookups where the tuple has no explicit pair with this key; it is called with one argument, the tuple. 
Method
COMPARE
((key1 tuplekey) (key2 tuplekey)) 
Method
COMPARE
((x tupledesc) (y tupledesc)) 
Method
DOMAIN
((tup dyntuple)) 
Function
EMPTYTUPLE
Returns an empty tuple of the default implementation. 
Function
EMPTYDYNTUPLE
Returns an empty dyntuple. 
Macro
DOTUPLE
((keyvar valuevar tuple &optional value) &body body)For each pair of `tuple', binds `keyvar' and `valuevar' and executes `body'. When done, returns `value'. 
Method
COMPARE
((tup1 tuple) (tup2 tuple)) 
Method
WITH
((tuple tuple) (key tuplekey) &optional (value nil value?)) 
Method
LOOKUP
((tuple tuple) (key tuplekey)) 
GenericFunction
TUPLEMERGE
(tuple1 tuple2 &optional valfn)Returns a new tuple containing all the keys of `tuple1' and `tuple2', where the value for each key contained in only one tuple is the value from that tuple, and the value for each key contained in both tuples is the result of calling `valfn' on the value from `tuple1' and the value from `tuple2'. `valfn' defaults to simply returning its third argument, so the entries in `tuple2' simply shadow those in `tuple1'. 
Method
TUPLEMERGE
((tup1 tuple) (tup2 tuple) &optional (valfn #'(lambda (v1 v2) (declare (ignore v1)) v2))) 
Method
CONVERT
((totype (eql 'map)) (tup tuple) &key) 
Method
CONVERT
((totype (eql 'list)) (tup tuple) &key (pairfn #'cons)) 
Method
IMAGE
((key tuplekey) (s set)) 
Method
IMAGE
((key tuplekey) (s seq)) 
Method
RESTRICT
((tup tuple) (s set)) 
Method
RESTRICTNOT
((tup tuple) (s set)) 
Macro
SET
(&rest args)Constructs a set of the default implementation according to the supplied argument subforms. Each argument subform can be an expression, whose value will be a member of the result set; or a list of the form ($ `expression'), in which case the expression must evaluate to a set, all of whose members become members of the result set. 
Macro
WBSET
(&rest args)Constructs a wbset according to the supplied argument subforms. Each argument subform can be an expression, whose value will be a member of the result set; or a list of the form ($ `expression'), in which case the expression must evaluate to a set, all of whose members become members of the result set. 
Macro
BAG
(&rest args)Constructs a bag of the default implementation according to the supplied argument subforms. Each argument subform can be an expression, whose value will be added to the bag with multiplicity 1; or a list of the form ($ `expression'), in which case the expression must evaluate to a bag (or a set), which is bagsummed into the result; or a list of the form (% `expression1' `expression2') (called a "multiarg"), which indicates that the value of `expression1' is bagsummed into the result with multiplicity given by the value of `expression2'. That is, the multiplicity of each member of the result bag is the sum of its multiplicities as supplied by each of the argument subforms. 
Macro
WBBAG
(&rest args)Constructs a wbbag according to the supplied argument subforms. Each argument subform can be an expression, whose value will be added to the bag with multiplicity 1; or a list of the form ($ `expression'), in which case the expression must evaluate to a bag (or a set), which is bagsummed into the result; or a list of the form (% `expression1' `expression2') (called a "multiarg"), which indicates that the value of `expression1' is bagsummed into the result with multiplicity given by the value of `expression2'. That is, the multiplicity of each member of the result bag is the sum of its multiplicities as supplied by each of the argument subforms. 
Macro
MAP
(&rest args)Constructs a map of the default implementation according to the supplied argument subforms. Each argument subform can be a list of the form (`keyexpr' `valueexpr'), denoting a mapping from the value of `keyexpr' to the value of `valueexpr'; or a list of the form ($ `expression'), in which case the expression must evaluate to a map, denoting all its mappings; or the symbol `:default', in which case the next argument subform is a form whose value will become the map's default. The result is constructed from the denoted mappings in lefttoright order; so if a given key is supplied by more than one argument subform, its associated value will be given by the rightmost such subform. 
Macro
WBMAP
(&rest args)Constructs a wbmap according to the supplied argument subforms. Each argument subform can be a list of the form (`keyexpr' `valueexpr'), denoting a mapping from the value of `keyexpr' to the value of `valueexpr'; or a list of the form ($ `expression'), in which case the expression must evaluate to a map, denoting all its mappings; or the symbol `:default', in which case the next argument subform is a form whose value will become the map's default. The result is constructed from the denoted mappings in lefttoright order; so if a given key is supplied by more than one argument subform, its associated value will be given by the rightmost such subform. 
Macro
SEQ
(&rest args)Constructs a seq of the default implementation according to the supplied argument subforms. Each argument subform can be an expression whose value is to appear in the sequence; or a list of the form ($ `expression'), in which case the expression must evaluate to a sequence, all of whose values appear in the result sequence. The order of the result sequence reflects the order of the argument subforms. 
Macro
WBSEQ
(&rest args)Constructs a wbseq according to the supplied argument subforms. Each argument subform can be an expression whose value is to appear in the sequence; or a list of the form ($ `expression'), in which case the expression must evaluate to a sequence, all of whose values appear in the result sequence. The order of the result sequence reflects the order of the argument subforms. 
Macro
TUPLE
(&rest args)Constructs a tuple of the default implementation according to the supplied argument subforms. Each argument subform can be a list of the form (`keyexpr' `valueexpr'), denoting a mapping from the value of `keyexpr' to the value of `valueexpr'; or a list of the form ($ `expression'), in which case the expression must evaluate to a tuple, denoting all its mappings. The result is constructed from the denoted mappings in lefttoright order; so if a given key is supplied by more than one argument subform, its associated value will be given by the rightmost such subform. 
Macro
DYNTUPLE
(&rest args)Constructs a dyntuple according to the supplied argument subforms. Each argument subform can be a list of the form (`keyexpr' `valueexpr'), denoting a mapping from the value of `keyexpr' to the value of `valueexpr'; or a list of the form ($ `expression'), in which case the expression must evaluate to a tuple, denoting all its mappings. The result is constructed from the denoted mappings in lefttoright order; so if a given key is supplied by more than one argument subform, its associated value will be given by the rightmost such subform. 
Function
FSETSETUPREADTABLE
(readtable)Adds FSet reader macros to `readtable'. Returns `readtable'. 
Variable
*FSETREADTABLE*
(fset:fsetsetupreadtable (copyreadtable nil))
A copy of the standard readtable with FSet reader macros installed. 
Method
COMPARE
((x myinteger) (y myinteger)) 
Method
COMPARE
((x t) (iv interval)) 
Method
COMPARE
((iv interval) (x t)) 
Method
COMPARE
((iv0 interval) (iv1 interval)) 
Method
EMPTY?
((s intervalset)) 
Method
SIZE
((s intervalset))The number of intervals in the set. 
Method
WITH
((s intervalset) (iv interval) &optional (arg2 nil arg2?)) 
Method
LESS
((s intervalset) (iv interval) &optional (arg2 nil arg2?)) 
Method
UNION
((s0 intervalset) (s1 intervalset) &key) 
Method
INTERSECTION
((s0 intervalset) (s1 intervalset) &key) 
Method
SETDIFFERENCE
((s0 intervalset) (s1 intervalset) &key) 
Struct
RELATION
The abstract class for FSet relations. It is a structure class.No slots. 
GenericFunction
ARITY
(rel)Returns the arity of the relation `rel'. 
Struct
2RELATION
The abstract class for FSet binary relations. It is a structure class.No slots. 
Struct
WB2RELATION
A class of functional binary relations represented as pairs of weight balanced binary trees. This is the default implementation of binary relations in FSet. The inverse is constructed lazily, and maintained incrementally once constructed.
SIZE

MAP0

MAP1


Function
EMPTY2RELATION

Function
EMPTYWB2RELATION

Method
EMPTY?
((br wb2relation)) 
Method
SIZE
((br wb2relation)) 
Method
ARB
((br wb2relation)) 
Method
CONTAINS?
((br wb2relation) x &optional (y nil y?)) 
Method
LOOKUP
((br wb2relation) x)Returns the set of values that the relation pairs `x' with. 
GenericFunction
LOOKUPINV
(2relation y)Does an inverse lookup on a binary relation. 
Method
LOOKUPINV
((br wb2relation) y) 
Method
DOMAIN
((br wb2relation)) 
Method
RANGE
((br wb2relation)) 
GenericFunction
INVERSE
(2relation)The inverse of a binary relation. 
Method
INVERSE
((br wb2relation)) 
Method
LEAST
((br wb2relation)) 
Method
GREATEST
((br wb2relation)) 
Method
WITH
((br wb2relation) x &optional (y nil y?)) 
Method
LESS
((br wb2relation) x &optional (y nil y?)) 
Method
UNION
((br1 wb2relation) (br2 wb2relation) &key) 
Method
INTERSECTION
((br1 wb2relation) (br2 wb2relation) &key) 
GenericFunction
JOIN
(relationa columna relationb columnb)A relational equijoin, matching up `columna' of `relationa' with `columnb' of `relationb'. For a binary relation, the columns are named 0 (domain) and 1 (range). 
Method
JOIN
((bra wb2relation) cola (brb wb2relation) colb) 
Method
COMPOSE
((rel wb2relation) (fn function)) 
Method
COMPOSE
((rel wb2relation) (fn symbol)) 
Method
COMPOSE
((rel wb2relation) (fn map)) 
Method
COMPOSE
((rel wb2relation) (fn seq)) 
Method
COMPOSE
((rel1 wb2relation) (rel2 wb2relation)) 
Macro
DO2RELATION
((key val br &optional value) &body body)Enumerates all pairs of the relation `br', binding them successively to `key' and `val' and executing `body'. 
Method
CONVERT
((totype (eql 'set)) (br 2relation) &key (pairfn #'cons)) 
Method
CONVERT
((totype (eql '2relation)) (m map) &key fromtype)If `fromtype' is the symbol `maptosets', the range elements must all be sets, and the result pairs each domain element with each member of the corresponding range set. Otherwise, the result pairs each domain element with the corresponding range element directly. 
Method
CONVERT
((totype (eql 'wb2relation)) (m map) &key fromtype)If `fromtype' is the symbol `maptosets', the range elements must all be sets, and the result pairs each domain element with each member of the corresponding range set. Otherwise, the result pairs each domain element with the corresponding range element directly. 
Method
CONVERT
((totype (eql '2relation)) (alist list) &key (keyfn #'car) (valuefn #'cdr)) 
Method
CONVERT
((totype (eql 'wb2relation)) (alist list) &key (keyfn #'car) (valuefn #'cdr)) 
Method
CONVERT
((totype (eql '2relation)) (s seq) &key keyfn (valuefn #'identity)) 
Method
CONVERT
((totype (eql 'wb2relation)) (s seq) &key keyfn (valuefn #'identity)) 
Method
CONVERT
((totype (eql 'map)) (br wb2relation) &key)This conversion requires the relation to be functional, and returns a map representing the function; that is, the relation must map each domain value to a single range value, and the returned map maps that domain value to that range value. 
Method
CONVERT
((totype (eql 'wbmap)) (br wb2relation) &key)This conversion requires the relation to be functional, and returns a map representing the function; that is, the relation must map each domain value to a single range value, and the returned map maps that domain value to that range value. 
Method
CONVERT
((totype (eql 'maptosets)) (br wb2relation) &key)This conversion returns a map mapping each domain value to the set of corresponding range values. 
GenericFunction
CONFLICTS
(2relation)Returns a 2relation containing only those pairs of `2relation' whose domain value is mapped to multiple range values. 
Method
CONFLICTS
((br wb2relation)) 
Method
ITERATOR
((rel wb2relation) &key) 
Method
COMPARE
((a wb2relation) (b wb2relation)) 
Macro
2RELATION
(&rest args)Constructs a 2relation of the default implementation according to the supplied argument subforms. Each argument subform can be a list of the form (`keyexpr' `valueexpr'), denoting a mapping from the value of `keyexpr' to the value of `valueexpr'; or a list of the form ($ `expression'), in which case the expression must evaluate to a 2relation, all of whose mappings will be included in the result. Also, each of 'keyexpr' and 'valueexpr' can be of the form ($ `expression'), in which case the expression must evaluate to a set, and the elements of the set are used individually to form pairs; for example, the result of (2relation (($ (set 1 2)) ($ (set 'a 'b)))) contains the pairs <1, a>, <1, b>, <2, a>, and <2, b>. 
Macro
WB2RELATION
(&rest args)Constructs a wb2relation according to the supplied argument subforms. Each argument subform can be a list of the form (`keyexpr' `valueexpr'), denoting a mapping from the value of `keyexpr' to the value of `valueexpr'; or a list of the form ($ `expression'), in which case the expression must evaluate to a 2relation, all of whose mappings will be included in the result. Also, each of 'keyexpr' and 'valueexpr' can be of the form ($ `expression'), in which case the expression must evaluate to a set, and the elements of the set are used individually to form pairs; for example, the result of (wb2relation (($ (set 1 2)) ($ (set 'a 'b)))) contains the pairs <1, a>, <1, b>, <2, a>, and <2, b>. 
Struct
LISTRELATION
The abstract class for FSet list relations. It is a structure class. A list relation is a general relation (i.e. of arbitrary arity >= 2) whose tuples are in list form.No slots. 
Struct
WBLISTRELATION
A class of functional relations of arbitrary arity >= 2, whose tuples are in list form.
ARITY

TUPLES

INDICES


Function
EMPTYLISTRELATION
(&optional arity)We allow the arity to be temporarily unspecified; it will be taken from the first tuple added, or the first query. 
Function
EMPTYWBLISTRELATION
(arity)We allow the arity to be temporarily unspecified; it will be taken from the first tuple added, or the first query. 
Method
ARITY
((rel wblistrelation))Will return `nil' if the arity is not yet specified; see `emptylistrelation'. 
Method
EMPTY?
((rel wblistrelation)) 
Method
SIZE
((rel wblistrelation)) 
Method
ARB
((rel wblistrelation)) 
Method
CONTAINS?
((rel wblistrelation) tuple &optional (arg2 nil arg2?)) 
GenericFunction
QUERY
(relation pattern metapattern)Along with the relation, takes two lists, of equal length less than or equal to the arity, called the `pattern' and `metapattern'; returns a set of tuples satisfying the query. For each position, if the metapattern contains `nil', the query is not constrained by that position (the corresponding position in the pattern is ignored); if the metapattern contains `t' or `:single', then the result set contains only those tuples with the same value in that position as the pattern has. The difference between `t' and `:single' has to do with indexing. For each metapattern that is actually used, an index is constructed if not previously present, and then is maintained incrementally. If the metapattern has `t' in a location, the resulting index will contain all values for that location; if it has `:single', the resulting index will contain only those values that have actually appeared in a query pattern with this metapattern. 
Method
QUERY
((rel wblistrelation) (pattern list) (metapattern list)) 
GenericFunction
QUERYMULTI
(rel pattern metapattern)Like `query' (q.v.), except that `pattern' is a list of sets of values rather than a list of values. Returns all tuples in the relation for which each value is a member of the corresponding set in the pattern. `:single' in the metapattern is not accepted. 
Method
QUERYMULTI
((rel wblistrelation) (pattern list) (metapattern list)) 
Method
WITH
((rel wblistrelation) tuple &optional (arg2 nil arg2?)) 
Method
LESS
((rel wblistrelation) tuple &optional (arg2 nil arg2?)) 
Macro
DOLISTRELATION
((tuple rel &optional value) &body body) 
Struct
QUERYREGISTRY

ARITY

INDICES

KEYINDEX


Function
EMPTYQUERYREGISTRY
(&optional arity) 
Method
ARITY
((reg queryregistry)) 
Method
WITHQUERY
((reg queryregistry) (pattern list) (metapattern list) query &optional arity) 
Method
LESSQUERY
((reg queryregistry) (pattern list) (metapattern list) query) 
Method
ALLQUERIES
((reg queryregistry)) 
Method
LOOKUP
((reg queryregistry) tuple)Returns all queries in `reg' whose patterns match `tuple'. 
Method
LOOKUPMULTI
((reg queryregistry) settuple)Here `settuple' contains a set of values in each position. Returns all queries in `reg' whose patterns match any member of the cartesian product of the sets. 
Method
FORWARDKEY
((reg queryregistry) fromkey tokey)Returns a new queryregistry in which all queries whose patterns used `fromkey' (in an instantiated position) now use `tokey' in that position instead. 
Method
LOOKUPRESTRICTED
((reg queryregistry) tuple key)Returns all queries in `reg' whose patterns match `tuple' and which use `key' (in an instantiated position) in their patterns. 
Method
LOOKUPMULTIRESTRICTED
((reg queryregistry) settuple keys)Here `settuple' contains a set of values in each position. Returns all queries in `reg' whose patterns match any member of the cartesian product of the sets and which use a member of `keys' in their patterns. 
GenericFunction
COMPLEMENT
(set)Returns the complement of the set. 
Method
COMPLEMENT
((x function)) 
Method
COMPLEMENT
((s set)) 
Method
COMPLEMENT
((cs complementset)) 
Method
CONTAINS?
((cs complementset) x &optional (y nil y?)) 
Method
ARB
((cs complementset)) 
Method
SIZE
((cs complementset)) 
Method
WITH
((cs complementset) x &optional (arg2 nil arg2?)) 
Method
LESS
((cs complementset) x &optional (arg2 nil arg2?)) 
Method
UNION
((cs1 complementset) (cs2 complementset) &key) 
Method
UNION
((cs complementset) (s set) &key) 
Method
UNION
((s set) (cs complementset) &key) 
Method
INTERSECTION
((cs1 complementset) (cs2 complementset) &key) 
Method
INTERSECTION
((cs complementset) (s set) &key) 
Method
INTERSECTION
((s set) (cs complementset) &key) 
Method
SETDIFFERENCE
((cs1 complementset) (cs2 complementset) &key) 
Method
SETDIFFERENCE
((cs complementset) (s set) &key) 
Method
SETDIFFERENCE
((s set) (cs complementset) &key) 
Method
SUBSET?
((cs1 complementset) (cs2 complementset)) 
Method
SUBSET?
((cs complementset) (s set)) 
Method
SUBSET?
((s set) (cs complementset)) 
Method
DISJOINT?
((cs1 complementset) (cs2 complementset)) 
Method
DISJOINT?
((cs complementset) (s set)) 
Method
DISJOINT?
((s set) (cs complementset)) 
Method
COMPARE
((cs1 complementset) (cs2 complementset)) 
Method
COMPARE
((cs complementset) (s set)) 
Method
COMPARE
((s set) (cs complementset)) 
Struct
BOUNDEDSET
A "bounded set" is a subset (not necessarily proper) of a specified set, called the "universe". (Topologically, it is a set in the discrete topology on the universe.)
UNIVERSE

SET

COMPLEMENT?


Function
MAKEBOUNDEDSET
(universe set &optional complement?) 
Function
BOUNDEDSETCONTENTS
(bs) 
Method
COMPLEMENT
((bs boundedset)) 
Method
EMPTY?
((bs boundedset)) 
Method
CONTAINS?
((bs boundedset) x &optional (arg2 nil arg2?)) 
Method
ARB
((bs boundedset)) 
Method
SIZE
((bs boundedset)) 
Method
WITH
((bs1 boundedset) x &optional (arg2 nil arg2?)) 
Method
LESS
((bs1 boundedset) x &optional (arg2 nil arg2?)) 
Method
UNION
((bs1 boundedset) (bs2 boundedset) &key) 
Method
INTERSECTION
((bs1 boundedset) (bs2 boundedset) &key) 
Method
SETDIFFERENCE
((bs1 boundedset) (bs2 boundedset) &key) 
Method
SUBSET?
((bs1 boundedset) (bs2 boundedset)) 
Method
DISJOINT?
((bs1 boundedset) (bs2 boundedset)) 
Method
COMPARE
((bs1 boundedset) (bs2 boundedset)) 
Method
COMPARE
((bs boundedset) (s set)) 
Method
COMPARE
((s set) (bs boundedset)) 
Method
CONVERT
((totype (eql 'wbset)) (bs boundedset) &key)
FSETUSER
No exported symbols.