fset

API Reference

fset

A functional set-theoretic collections library. See: http://www.ergy.com/FSet.html

FSET

  • Generic-Function 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 COMPARE-SLOTS (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 `slot-value'. For example, if class `frob' has accessor `frob-foo' and slot `bar': (defmethod compare ((f1 frob) (f2 frob)) (compare-slots f1 f2 #'frob-foo '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 MAP-DEFAULT (instance)
  • Function (setf MAP-DEFAULT) (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 IDENTITY-ORDERING-MIXIN
    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.
    SERIAL-NUMBER   Accessor: SERIAL-NUMBER
    NEXT-SERIAL-NUMBER
    NEXT-SERIAL-NUMBER-LOCK
  • Method COMPARE ((obj1 identity-ordering-mixin) (obj2 identity-ordering-mixin))
  • Method COMPARE ((a t) (b t))
  • Macro DEFINE-CROSS-TYPE-COMPARE-METHODS (type)
    Generates cross-type 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))
  • Generic-Function COMPARE-LEXICOGRAPHICALLY (a b)
    Returns the result of a lexicographic comparison of `a' and `b', which can be strings, vectors, lists, or seqs.
  • Method COMPARE-LEXICOGRAPHICALLY ((a string) (b string))
  • Method COMPARE-LEXICOGRAPHICALLY ((a list) (b list))
  • Method COMPARE-LEXICOGRAPHICALLY ((a vector) (b vector))
  • Method COMPARE (x (eqvs equivalent-set))
    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 equivalent-set) 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 equivalent-set) (eqvs2 equivalent-set))
    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 equivalent-bag))
    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 equivalent-bag) 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 equivalent-bag) (eqvs2 equivalent-bag))
    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 equivalent-map))
    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 equivalent-map) 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 equivalent-map) (eqvm2 equivalent-map))
    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'.
  • Generic-Function EMPTY? (collection)
    Returns true iff the collection is empty.
  • Function NONEMPTY? (collection)
    Returns true iff the collection is not empty.
  • Generic-Function 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.
  • Generic-Function SET-SIZE (bag)
    Returns the number of unique members in the bag.
  • Generic-Function 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?'.
  • Generic-Function CONTAINS? (collection x &optional y)
    Returns true iff the set or bag contains `x', or the map or relation contains the pair <x, y>.
  • Generic-Function DOMAIN-CONTAINS? (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.)
  • Generic-Function RANGE-CONTAINS? (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.
  • Generic-Function MULTIPLICITY (bag x)
    Returns the multiplicity of `x' in the bag.
  • Generic-Function 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.
  • Generic-Function 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.
  • Generic-Function 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 (0-origin, 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.
  • Generic-Function 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.
  • Generic-Function AT-RANK (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 @ (fn-or-collection &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 higher-order code in a two-namespace 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 side-effect-free 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.
  • Generic-Function 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).
  • Generic-Function 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.
  • Generic-Function UNION (set-or-bag1 set-or-bag2 &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.
  • Generic-Function BAG-SUM (bag1 bag2)
    Returns a bag whose multiplicity, for any value, is the sum of its multiplicities in the two argument bags.
  • Generic-Function INTERSECTION (set-or-bag1 set-or-bag2 &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.
  • Generic-Function BAG-PRODUCT (bag1 bag2)
    Returns a bag whose multiplicity, for any value, is the product of its multiplicities in the two argument bags.
  • Generic-Function SET-DIFFERENCE (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'.
  • Generic-Function SET-DIFFERENCE-2 (set1 set2)
    Returns `set1 - set2' and `set2 - set1' as two values.
  • Generic-Function BAG-DIFFERENCE (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.
  • Generic-Function SUBSET? (sub super)
    Returns true iff `sub' is a subset of `super'.
  • Generic-Function DISJOINT? (set1 set2)
    Returns true iff `set1' and `set2' have a null intersection (without actually constructing said intersection).
  • Generic-Function 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.
  • Generic-Function 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 map-default 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).
  • Generic-Function PARTITION (pred collection)
    Returns two values, (filter fn collection) and (filter (cl:complement fn) collection).
  • Generic-Function FILTER-PAIRS (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 FILTER-PAIRS (fn (collection t))
  • Generic-Function 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 map-default 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))
  • Generic-Function REDUCE (fn collection &key key initial-value)
    If `collection' is a Lisp sequence, this simply calls `cl:reduce' (q.v.). On an FSet collection, the `:start', `:end', and `:from-end' keywords are accepted only if `collection' is a seq.
  • Method REDUCE (fn (s sequence) &rest keyword-args &key key initial-value start end from-end)
  • Generic-Function DOMAIN (map)
    Returns the domain of the map, that is, the set of keys mapped by the map.
  • Generic-Function RANGE (map)
    Returns the range of the map, that is, the set of all values to which keys are mapped by the map.
  • Generic-Function WITH-DEFAULT (collection new-default)
    Returns a new map or seq with the same contents as `collection' but whose default is now `new-default'.
  • Generic-Function MAP-UNION (map1 map2 &optional val-fn)
    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 `val-fn' on the value from `map1' and the value from `map2'. `val-fn' 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 `val-fn' on the defaults for the two maps (so be sure it can take these values).
  • Generic-Function MAP-INTERSECTION (map1 map2 &optional val-fn)
    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 `val-fn' on the value from `map1' and the value from `map2'. `val-fn' 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 `val-fn' on the defaults for the two maps (so be sure it can take these values).
  • Generic-Function MAP-DIFFERENCE-2 (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'.
  • Generic-Function RESTRICT (map set)
    Returns a map containing only those pairs of `map' whose keys are also in `set'.
  • Generic-Function RESTRICT-NOT (map set)
    Returns a map containing only those pairs of `map' whose keys are not in `set'.
  • Generic-Function COMPOSE (map1 map2-or-fn)
    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 `map2-or-fn' to the result. `map2-or-fn' can also be a sequence, which is treated as a map from indices to members.
  • Generic-Function 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))
  • Generic-Function 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))
  • Generic-Function WITH-FIRST (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.
  • Generic-Function WITH-LAST (seq val)
    Returns `seq' with `val' appended, that is, `val' is element `(size seq)' of the result.
  • Generic-Function LESS-FIRST (seq)
    Returns the subsequence of `seq' from element 1 through the end.
  • Generic-Function LESS-LAST (seq)
    Returns the subsequence of `seq' from element 0 through the next-to-last element.
  • Generic-Function 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).
  • Generic-Function 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).
  • Generic-Function CONCAT (seq1 &rest seqs)
    Returns the concatenation of `seq1' with each of `seqs'.
  • Generic-Function CONVERT (to-type collection &key)
    Converts the collection to the specified type. Some methods may take additional keyword arguments to further specify the kind of conversion.
  • Generic-Function ITERATOR (collection &key)
    Returns an iterator for the collection. (These are stateful iterators and are not thread-safe; 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)
  • Generic-Function 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)
  • Generic-Function REVERSE (seq)
    Returns `seq' in reverse order.
  • Method REVERSE ((s sequence))
  • Generic-Function 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)
  • Generic-Function STABLE-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 guaranteed to be stable. The method for CL sequences copies the sequence first, unlike `cl:stable-sort'.
  • Method STABLE-SORT ((s sequence) pred &key key)
  • Generic-Function 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 `:test-not' keyword is not accepted; and the `:start', `:end', and `:from-end' 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 keyword-args &key key test test-not start end from-end)
  • Generic-Function FIND-IF (pred collection &key key)
    If `collection' is a Lisp sequence, this simply calls `cl:find-if'. On an FSet collection, the `:start', `:end', and `:from-end' 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-IF (pred (s sequence) &rest keyword-args &key key start end from-end)
  • Generic-Function FIND-IF-NOT (pred collection &key key)
    If `collection' is a Lisp sequence, this simply calls `cl:find-if-not'. On an FSet collection, the `:start', `:end', and `:from-end' 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-IF-NOT (pred (s sequence) &rest keyword-args &key key start end from-end)
  • Generic-Function 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 `:test-not' keyword is not accepted; and the `:start', `:end', and `:from-end' keywords are accepted only if `collection' is a seq. Also, on a map, this scans the domain.
  • Method COUNT (item (s sequence) &rest keyword-args &key key test test-not start end from-end)
  • Generic-Function COUNT-IF (pred collection &key key)
    If `collection' is a Lisp sequence, this simply calls `cl:count-if'. On an FSet collection, the `:start', `:end', and `:from-end' keywords are accepted only if `collection' is a seq. Also, on a map, this scans the domain.
  • Method COUNT-IF (pred (s sequence) &rest keyword-args &key key start end from-end)
  • Generic-Function COUNT-IF-NOT (pred collection &key key)
    If `collection' is a Lisp sequence, this simply calls `cl:count-if-not'. On an FSet collection, the `:start', `:end', and `:from-end' keywords are accepted only if `collection' is a seq. Also, on a map, this scans the domain.
  • Method COUNT-IF-NOT (pred (s sequence) &rest keyword-args &key key start end from-end)
  • Generic-Function POSITION (item collection &key key test start end from-end)
    If `collection' is a Lisp sequence, this simply calls `cl:position'. On an FSet seq, the default for `test' is `equal?', and the `:test-not' keyword is not accepted.
  • Method POSITION (item (s sequence) &rest keyword-args &key key test test-not start end from-end)
  • Generic-Function POSITION-IF (pred collection &key key start end from-end)
    If `collection' is a Lisp sequence, this simply calls `cl:position-if'. Also works on an FSet seq.
  • Method POSITION-IF (pred (s sequence) &rest keyword-args &key key start end from-end)
  • Generic-Function POSITION-IF-NOT (pred collection &key key start end from-end)
    If `collection' is a Lisp sequence, this simply calls `cl:position-if-not'. Also works on an FSet seq.
  • Method POSITION-IF-NOT (pred (s sequence) &rest keyword-args &key key start end from-end)
  • Generic-Function 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 `:test-not' keyword is not accepted.
  • Method REMOVE (item (s sequence) &rest keyword-args &key key test start end from-end count)
  • Generic-Function REMOVE-IF (pred collection &key key)
    If `collection' is a Lisp sequence, this simply calls `cl:remove-if'. Also works on an FSet seq; but see `filter'.
  • Method REMOVE-IF (pred (s sequence) &rest keyword-args &key key start end from-end count)
  • Generic-Function REMOVE-IF-NOT (pred collection &key key)
    If `collection' is a Lisp sequence, this simply calls `cl:remove-if-not'. Also works on an FSet seq; but see `filter'.
  • Method REMOVE-IF-NOT (pred (s sequence) &rest keyword-args &key key start end from-end count)
  • Generic-Function 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 `:test-not' keyword is not accepted.
  • Method SUBSTITUTE (newitem olditem (s sequence) &rest keyword-args &key key test start end from-end count)
  • Generic-Function SUBSTITUTE-IF (newitem pred collection &key key)
    If `collection' is a Lisp sequence, this simply calls `cl:substitute-if'. Also works on an FSet seq.
  • Method SUBSTITUTE-IF (newitem pred (s sequence) &rest keyword-args &key key start end from-end count)
  • Generic-Function SUBSTITUTE-IF-NOT (newitem pred collection &key key)
    If `collection' is a Lisp sequence, this simply calls `cl:substitute-if-not'. Also works on an FSet seq.
  • Method SUBSTITUTE-IF-NOT (newitem pred (s sequence) &rest keyword-args &key key start end from-end count)
  • Method UNION ((ls1 list) (ls2 list) &rest keyword-args &key test test-not)
  • Method INTERSECTION ((ls1 list) (ls2 list) &rest keyword-args &key test test-not)
  • Method SET-DIFFERENCE ((ls1 list) (ls2 list) &rest keyword-args &key test test-not)
  • 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 item-or-tuple &environment env)
    (adjoinf coll . args) --> (setf coll (with coll . args))
  • Macro REMOVEF (place &rest item-or-tuple &environment env)
    (removef coll . args) --> (setf coll (less coll . args))
  • Macro INCLUDEF (place &rest item-or-tuple &environment env)
    (includef coll . args) --> (setf coll (with coll . args))
  • Macro EXCLUDEF (place &rest item-or-tuple &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 PUSH-FIRST (place val &environment env)
    (push-first seq val) --> (setf seq (with-first seq val))
  • Macro PUSH-LAST (place val &environment env)
    (push-last seq val) --> (setf seq (with-last seq val))
  • Macro POP-FIRST (seq &environment env)
    Removes the first element from `seq' and returns it.
  • Macro POP-LAST (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 WB-SET
    A class of functional sets represented as weight-balanced binary trees. This is the default implementation of sets in FSet.
    CONTENTS
  • Function EMPTY-SET
    Returns an empty set of the default implementation.
  • Function EMPTY-WB-SET
    Returns an empty wb-set.
  • Method EMPTY? ((s wb-set))
  • Method SIZE ((s wb-set))
  • Method SET-SIZE ((s wb-set))
  • Method ARB ((s wb-set))
  • Method CONTAINS? ((s wb-set) x &optional (y nil y?))
  • Method LOOKUP ((s wb-set) key)
  • Method RANK ((s wb-set) x)
  • Method AT-RANK ((s wb-set) rank)
  • Method LEAST ((s wb-set))
  • Method GREATEST ((s wb-set))
  • Method WITH ((s wb-set) value &optional (arg2 nil arg2?))
  • Method LESS ((s wb-set) value &optional (arg2 nil arg2?))
  • Method SPLIT-FROM ((s wb-set) value)
  • Method SPLIT-ABOVE ((s wb-set) value)
  • Method SPLIT-THROUGH ((s wb-set) value)
  • Method SPLIT-BELOW ((s wb-set) value)
  • Method UNION ((s1 wb-set) (s2 wb-set) &key)
  • Method INTERSECTION ((s1 wb-set) (s2 wb-set) &key)
  • Method SET-DIFFERENCE ((s1 wb-set) (s2 wb-set) &key)
  • Method SET-DIFFERENCE-2 ((s1 wb-set) (s2 wb-set))
  • Method SUBSET? ((s1 wb-set) (s2 wb-set))
  • Method DISJOINT? ((s1 wb-set) (s2 wb-set))
  • Method COMPARE ((s1 wb-set) (s2 wb-set))
  • Macro DO-SET ((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 wb-set) &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 (initial-value nil init?))
  • Method REDUCE ((fn symbol) (s set) &key key (initial-value nil init?))
  • Method SORT ((s set) pred &key key)
  • Method STABLE-SORT ((s set) pred &key key)
  • Method CONVERT ((to-type (eql 'bag)) (s wb-set) &key)
  • Method CONVERT ((to-type (eql 'wb-bag)) (s wb-set) &key)
  • Method CONVERT ((to-type (eql 'list)) (s set) &key)
  • Method CONVERT ((to-type (eql 'vector)) (s set) &key)
  • Method CONVERT ((to-type (eql 'set)) (l list) &key)
  • Method CONVERT ((to-type (eql 'wb-set)) (l list) &key)
  • Method CONVERT ((to-type (eql 'set)) (s sequence) &key)
  • Method CONVERT ((to-type (eql 'wb-set)) (s sequence) &key)
  • Method FIND (item (s set) &key key test)
  • Method FIND-IF (pred (s set) &key key)
  • Method FIND-IF-NOT (pred (s set) &key key)
  • Method COUNT (item (s set) &key key test)
  • Method COUNT-IF (pred (s set) &key key)
  • Method COUNT-IF-NOT (pred (s set) &key key)
  • Struct WB-BAG
    A class of functional bags (multisets) represented as weight-balanced binary trees. This is the default implementation of bags in FSet.
    CONTENTS
  • Function EMPTY-BAG
    Returns an empty bag of the default implementation.
  • Function EMPTY-WB-BAG
    Returns an empty wb-bag.
  • Method EMPTY? ((b wb-bag))
  • Method ARB ((m wb-bag))
  • Method CONTAINS? ((b wb-bag) x &optional (y nil y?))
  • Method LOOKUP ((b wb-bag) x)
  • Method RANK ((s wb-bag) x)
  • Method AT-RANK ((s wb-bag) rank)
  • Method LEAST ((b wb-bag))
  • Method GREATEST ((m wb-bag))
  • Method SIZE ((b wb-bag))
  • Method SET-SIZE ((b wb-bag))
  • Method MULTIPLICITY ((b wb-bag) x)
  • Method MULTIPLICITY ((s set) x)
  • Method WITH ((b wb-bag) value &optional (multiplicity 1))
  • Method LESS ((b wb-bag) value &optional (multiplicity 1))
  • Method UNION ((b1 wb-bag) (b2 wb-bag) &key)
  • Method UNION ((s wb-set) (b wb-bag) &key)
  • Method UNION ((b wb-bag) (s wb-set) &key)
  • Method BAG-SUM ((b1 wb-bag) (b2 wb-bag))
  • Method BAG-SUM ((s wb-set) (b wb-bag))
  • Method BAG-SUM ((b wb-bag) (s wb-set))
  • Method INTERSECTION ((s1 wb-bag) (s2 wb-bag) &key)
  • Method INTERSECTION ((s wb-set) (b wb-bag) &key)
  • Method INTERSECTION ((b wb-bag) (s wb-set) &key)
  • Method BAG-PRODUCT ((b1 wb-bag) (b2 wb-bag))
  • Method BAG-PRODUCT ((s wb-set) (b wb-bag))
  • Method BAG-PRODUCT ((b wb-bag) (s wb-set))
  • Method BAG-DIFFERENCE ((b1 wb-bag) (b2 wb-bag))
  • Method BAG-DIFFERENCE ((s wb-set) (b wb-bag))
  • Method BAG-DIFFERENCE ((b wb-bag) (s wb-set))
  • Method SUBBAG? ((b1 wb-bag) (b2 wb-bag))
  • Method SUBBAG? ((s wb-set) (b wb-bag))
  • Method SUBBAG? ((b wb-bag) (s wb-set))
  • Method COMPARE ((b1 wb-bag) (b2 wb-bag))
  • Macro DO-BAG-PAIRS ((value-var mult-var bag &optional value) &body body)
    For each member of `bag', binds `value-var' and `mult-var' to the member and its multiplicity respectively, and executes `body'. When done, returns `value'.
  • Macro DO-BAG ((value-var bag &optional value) &body body)
    For each member of `bag', binds `value-var' to it and and executes `body' a number of times equal to the member's multiplicity. When done, returns `value'.
  • Method ITERATOR ((b wb-bag) &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 FILTER-PAIRS ((pred function) (b bag))
  • Method FILTER-PAIRS ((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 (initial-value nil init?))
  • Method REDUCE ((fn symbol) (b bag) &key key (initial-value nil init?))
  • Method CONVERT ((to-type (eql 'set)) (b wb-bag) &key)
  • Method CONVERT ((to-type (eql 'wb-set)) (b wb-bag) &key)
  • Method CONVERT ((to-type (eql 'list)) (b bag) &key)
  • Method CONVERT ((to-type (eql 'seq)) (b bag) &key)
  • Method CONVERT ((to-type (eql 'vector)) (b bag) &key)
  • Method CONVERT ((to-type (eql 'alist)) (b bag) &key)
  • Method CONVERT ((to-type (eql 'bag)) (l list) &key from-type)
    If `from-type' 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 ((to-type (eql 'wb-bag)) (l list) &key from-type)
    If `from-type' 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 ((to-type (eql 'bag)) (s sequence) &key)
  • Method CONVERT ((to-type (eql 'wb-bag)) (s sequence) &key)
  • Method FIND (item (b bag) &key key test)
  • Method FIND-IF (pred (b bag) &key key)
  • Method FIND-IF-NOT (pred (b bag) &key key)
  • Method COUNT (item (b bag) &key key test)
  • Method COUNT-IF (pred (b bag) &key key)
  • Method COUNT-IF-NOT (pred (s bag) &key key)
  • Struct WB-MAP
    A class of functional maps represented as weight-balanced binary trees. This is the default implementation of maps in FSet.
    CONTENTS
  • Function EMPTY-MAP (&optional default)
    Returns an empty map of the default implementation.
  • Function EMPTY-WB-MAP (&optional default)
    Returns an empty wb-map.
  • Method WITH-DEFAULT ((m wb-map) new-default)
  • Method EMPTY? ((m wb-map))
  • Method ARB ((m wb-map))
  • Method LEAST ((m wb-map))
  • Method GREATEST ((m wb-map))
  • Method SIZE ((m wb-map))
  • Method CONTAINS? ((m wb-map) x &optional (y nil y?))
  • Method LOOKUP ((m wb-map) key)
  • Method RANK ((s wb-map) x)
  • Method AT-RANK ((s wb-map) rank)
  • Method WITH ((m wb-map) key &optional (value nil value?))
  • Method LESS ((m wb-map) key &optional (arg2 nil arg2?))
  • Method DOMAIN ((m wb-map))
  • Method COMPARE ((map1 wb-map) (map2 wb-map))
  • Macro DO-MAP ((key-var value-var map &optional value) &body body)
    For each pair of `map', binds `key-var' and `value-var' and executes `body'. When done, returns `value'.
  • Macro DO-MAP-DOMAIN ((key-var map &optional value) &body body)
    For each pair of `map', binds `key-var' and executes `body'. When done, returns `value'.
  • Method ITERATOR ((m wb-map) &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 (initial-value nil init?))
  • Method REDUCE ((fn symbol) (m map) &key key (initial-value nil init?))
  • Method RANGE ((m map))
  • Method DOMAIN-CONTAINS? ((m wb-map) x)
  • Method RANGE-CONTAINS? ((m wb-map) x)
  • Method MAP-UNION ((map1 wb-map) (map2 wb-map) &optional (val-fn #'(lambda (v1 v2) (declare (ignore v1)) v2)))
  • Method MAP-INTERSECTION ((map1 wb-map) (map2 wb-map) &optional (val-fn #'(lambda (v1 v2) (declare (ignore v1)) v2)))
  • Method MAP-DIFFERENCE-2 ((map1 wb-map) (map2 wb-map))
  • Method RESTRICT ((m wb-map) (s wb-set))
  • Method RESTRICT-NOT ((m wb-map) (s wb-set))
  • Method COMPOSE ((map1 map) (map2 wb-map))
  • Method COMPOSE ((m wb-map) (fn function))
  • Method COMPOSE ((m wb-map) (fn symbol))
  • Method COMPOSE ((m wb-map) (s seq))
  • Method CONVERT ((to-type (eql 'list)) (m map) &key (pair-fn #'cons))
  • Method CONVERT ((to-type (eql 'seq)) (m map) &key (pair-fn #'cons))
  • Method CONVERT ((to-type (eql 'vector)) (m map) &key (pair-fn #'cons))
  • Method CONVERT ((to-type (eql 'set)) (m map) &key (pair-fn #'cons))
  • Method CONVERT ((to-type (eql 'map)) (list list) &key (key-fn #'car) (value-fn #'cdr))
  • Method CONVERT ((to-type (eql 'wb-map)) (list list) &key (key-fn #'car) (value-fn #'cdr))
  • Method CONVERT ((to-type (eql 'map)) (s sequence) &key (key-fn #'car) (value-fn #'cdr))
  • Method CONVERT ((to-type (eql 'wb-map)) (s sequence) &key (key-fn #'car) (value-fn #'cdr))
  • Method CONVERT ((to-type (eql 'map)) (b bag) &key)
  • Method CONVERT ((to-type (eql 'wb-map)) (b bag) &key)
  • Method CONVERT ((to-type (eql 'map)) (ht hash-table) &key)
  • Method CONVERT ((to-type (eql 'wb-map)) (ht hash-table) &key)
  • Method CONVERT ((to-type (eql 'hash-table)) (m map) &rest make-hash-table-args &key &allow-other-keys)
  • Method FIND (item (m map) &key key test)
  • Method FIND-IF (pred (m map) &key key)
  • Method FIND-IF-NOT (pred (m map) &key key)
  • Method COUNT (item (m map) &key key test)
  • Method COUNT-IF (pred (m map) &key key)
  • Method COUNT-IF-NOT (pred (m map) &key key)
  • Struct WB-SEQ
    A class of functional seqs (sequences, but we use the short name to avoid confusion with `cl:sequence') represented as weight-balanced binary trees. This is the default implementation of seqs in FSet.
    CONTENTS
  • Function EMPTY-SEQ (&optional default)
    Returns an empty seq of the default implementation.
  • Function EMPTY-WB-SEQ
    Returns an empty wb-seq.
  • Method EMPTY? ((s wb-seq))
  • Method WITH-DEFAULT ((s wb-seq) new-default)
  • Method SIZE ((s wb-seq))
  • Method LOOKUP ((s wb-seq) key)
  • Method FIRST ((s wb-seq))
  • Method LAST ((s wb-seq))
  • Method WITH-FIRST ((s wb-seq) val)
  • Method WITH-LAST ((s wb-seq) val)
  • Method LESS-FIRST ((s wb-seq))
  • Method LESS-LAST ((s wb-seq))
  • Method WITH ((s wb-seq) idx &optional (val nil val?))
  • Method INSERT ((s wb-seq) idx val)
  • Method SPLICE ((s wb-seq) idx subseq)
  • Method LESS ((s wb-seq) idx &optional (arg2 nil arg2?))
  • Method CONCAT ((s1 seq) &rest seqs)
  • Method SUBSEQ ((s wb-seq) start &optional end)
  • Method REVERSE ((s wb-seq))
  • Method SORT ((s wb-seq) pred &key key)
  • Method STABLE-SORT ((s wb-seq) pred &key key)
  • Method DOMAIN ((s wb-seq))
  • Method RANGE ((s wb-seq))
  • Method CONVERT ((to-type (eql 'seq)) (vec vector) &key)
  • Method CONVERT ((to-type (eql 'wb-seq)) (vec vector) &key)
  • Method CONVERT ((to-type (eql 'vector)) (s wb-seq) &key)
  • Method CONVERT ((to-type (eql 'string)) (s wb-seq) &key)
  • Method CONVERT ((to-type (eql 'seq)) (l list) &key)
  • Method CONVERT ((to-type (eql 'wb-seq)) (l list) &key)
  • Method CONVERT ((to-type (eql 'list)) (s wb-seq) &key)
  • Method CONVERT ((to-type (eql 'seq)) (s set) &key)
  • Method CONVERT ((to-type (eql 'wb-seq)) (s set) &key)
  • Method CONVERT ((to-type (eql 'set)) (s wb-seq) &key)
  • Method CONVERT ((to-type (eql 'wb-set)) (s wb-seq) &key)
  • Method CONVERT ((to-type (eql 'wb-seq)) (b bag) &key)
  • Method CONVERT ((to-type (eql 'wb-seq)) (m map) &key (pair-fn #'cons))
  • Method COMPARE ((s1 wb-seq) (s2 wb-seq))
  • Method COMPARE-LEXICOGRAPHICALLY ((s1 wb-seq) (s2 wb-seq))
  • Macro DO-SEQ ((var seq &key (start nil start?) (end nil end?) (from-end? nil from-end??) (index nil index?) (value nil)) &body body)
    For each element of `seq', possibly restricted by `start' and `end', and in reverse order if `from-end?' 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 wb-seq) &key)
  • Method DOMAIN-CONTAINS? ((s seq) x)
  • Method RANGE-CONTAINS? ((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 (initial-value nil init?) (start 0) (end (size s)) (from-end nil))
  • Method REDUCE ((fn symbol) (s seq) &key key (initial-value nil init?) (start 0) (end (size s)) (from-end nil))
  • Method FIND (item (s seq) &key key test start end from-end)
  • Method FIND-IF (pred (s seq) &key key start end from-end)
  • Method FIND-IF-NOT (pred (s seq) &key key start end from-end)
  • Method COUNT (item (s seq) &key key test start end from-end)
  • Method COUNT-IF (pred (s seq) &key key start end from-end)
  • Method COUNT-IF-NOT (pred (s seq) &key key start end from-end)
  • Method POSITION (item (s seq) &key key test start end from-end)
  • Method POSITION-IF (pred (s seq) &key key start end from-end)
  • Method POSITION-IF-NOT (pred (s seq) &key key start end from-end)
  • Method REMOVE (item (s seq) &key key test start end from-end count)
  • Method REMOVE-IF (pred (s seq) &key key start end from-end count)
  • Method REMOVE-IF-NOT (pred (s seq) &key key start end from-end count)
  • Method SUBSTITUTE (newitem olditem (s seq) &key key test start end from-end count)
  • Method SUBSTITUTE-IF (newitem pred (s seq) &key key start end from-end count)
  • Method SUBSTITUTE-IF-NOT (newitem pred (s seq) &key key start end from-end count)
  • Method EMPTY? ((l list))
  • Method EMPTY? ((s sequence))
  • Method SIZE ((s sequence))
  • Method LOOKUP ((s sequence) (idx integer))
  • Struct DYN-TUPLE
    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 TUPLE-KEY? (object)
  • Function TUPLE-KEY-NAME (instance)
  • Function (setf TUPLE-KEY-NAME) (value instance)
  • Function GET-TUPLE-KEY (name &optional default-fn)
    Finds or creates a tuple key named `name'. If the key did not already exist, and `default-fn' 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 DEF-TUPLE-KEY (name &optional default-fn)
    Deprecated; use `define-tuple-key'.
  • Macro DEFINE-TUPLE-KEY (name &optional default-fn)
    Defines a tuple key named `name' as a global lexical variable (see `deflex'). If `default-fn' 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 tuple-key) (key2 tuple-key))
  • Method COMPARE ((x tuple-desc) (y tuple-desc))
  • Method DOMAIN ((tup dyn-tuple))
  • Function EMPTY-TUPLE
    Returns an empty tuple of the default implementation.
  • Function EMPTY-DYN-TUPLE
    Returns an empty dyn-tuple.
  • Macro DO-TUPLE ((key-var value-var tuple &optional value) &body body)
    For each pair of `tuple', binds `key-var' and `value-var' and executes `body'. When done, returns `value'.
  • Method COMPARE ((tup1 tuple) (tup2 tuple))
  • Method WITH ((tuple tuple) (key tuple-key) &optional (value nil value?))
  • Method LOOKUP ((tuple tuple) (key tuple-key))
  • Generic-Function TUPLE-MERGE (tuple1 tuple2 &optional val-fn)
    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 `val-fn' on the value from `tuple1' and the value from `tuple2'. `val-fn' defaults to simply returning its third argument, so the entries in `tuple2' simply shadow those in `tuple1'.
  • Method TUPLE-MERGE ((tup1 tuple) (tup2 tuple) &optional (val-fn #'(lambda (v1 v2) (declare (ignore v1)) v2)))
  • Method CONVERT ((to-type (eql 'map)) (tup tuple) &key)
  • Method CONVERT ((to-type (eql 'list)) (tup tuple) &key (pair-fn #'cons))
  • Method IMAGE ((key tuple-key) (s set))
  • Method IMAGE ((key tuple-key) (s seq))
  • Method RESTRICT ((tup tuple) (s set))
  • Method RESTRICT-NOT ((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 WB-SET (&rest args)
    Constructs a wb-set 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 bag-summed into the result; or a list of the form (% `expression1' `expression2') (called a "multi-arg"), which indicates that the value of `expression1' is bag-summed 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 WB-BAG (&rest args)
    Constructs a wb-bag 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 bag-summed into the result; or a list of the form (% `expression1' `expression2') (called a "multi-arg"), which indicates that the value of `expression1' is bag-summed 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 (`key-expr' `value-expr'), denoting a mapping from the value of `key-expr' to the value of `value-expr'; 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 left-to-right 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 WB-MAP (&rest args)
    Constructs a wb-map according to the supplied argument subforms. Each argument subform can be a list of the form (`key-expr' `value-expr'), denoting a mapping from the value of `key-expr' to the value of `value-expr'; 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 left-to-right 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 WB-SEQ (&rest args)
    Constructs a wb-seq 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 (`key-expr' `value-expr'), denoting a mapping from the value of `key-expr' to the value of `value-expr'; 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 left-to-right 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 DYN-TUPLE (&rest args)
    Constructs a dyn-tuple according to the supplied argument subforms. Each argument subform can be a list of the form (`key-expr' `value-expr'), denoting a mapping from the value of `key-expr' to the value of `value-expr'; 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 left-to-right 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 FSET-SETUP-READTABLE (readtable)
    Adds FSet reader macros to `readtable'. Returns `readtable'.
  • Variable *FSET-READTABLE*
    (fset:fset-setup-readtable (copy-readtable nil))
    A copy of the standard readtable with FSet reader macros installed.
  • Method COMPARE ((x my-integer) (y my-integer))
  • Method COMPARE ((x t) (iv interval))
  • Method COMPARE ((iv interval) (x t))
  • Method COMPARE ((iv0 interval) (iv1 interval))
  • Method EMPTY? ((s interval-set))
  • Method SIZE ((s interval-set))
    The number of intervals in the set.
  • Method WITH ((s interval-set) (iv interval) &optional (arg2 nil arg2?))
  • Method LESS ((s interval-set) (iv interval) &optional (arg2 nil arg2?))
  • Method UNION ((s0 interval-set) (s1 interval-set) &key)
  • Method INTERSECTION ((s0 interval-set) (s1 interval-set) &key)
  • Method SET-DIFFERENCE ((s0 interval-set) (s1 interval-set) &key)
  • Struct RELATION
    The abstract class for FSet relations. It is a structure class.
    No slots.
  • Generic-Function ARITY (rel)
    Returns the arity of the relation `rel'.
  • Struct 2-RELATION
    The abstract class for FSet binary relations. It is a structure class.
    No slots.
  • Struct WB-2-RELATION
    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 EMPTY-2-RELATION
  • Function EMPTY-WB-2-RELATION
  • Method EMPTY? ((br wb-2-relation))
  • Method SIZE ((br wb-2-relation))
  • Method ARB ((br wb-2-relation))
  • Method CONTAINS? ((br wb-2-relation) x &optional (y nil y?))
  • Method LOOKUP ((br wb-2-relation) x)
    Returns the set of values that the relation pairs `x' with.
  • Generic-Function LOOKUP-INV (2-relation y)
    Does an inverse lookup on a binary relation.
  • Method LOOKUP-INV ((br wb-2-relation) y)
  • Method DOMAIN ((br wb-2-relation))
  • Method RANGE ((br wb-2-relation))
  • Generic-Function INVERSE (2-relation)
    The inverse of a binary relation.
  • Method INVERSE ((br wb-2-relation))
  • Method LEAST ((br wb-2-relation))
  • Method GREATEST ((br wb-2-relation))
  • Method WITH ((br wb-2-relation) x &optional (y nil y?))
  • Method LESS ((br wb-2-relation) x &optional (y nil y?))
  • Method UNION ((br1 wb-2-relation) (br2 wb-2-relation) &key)
  • Method INTERSECTION ((br1 wb-2-relation) (br2 wb-2-relation) &key)
  • Generic-Function JOIN (relation-a column-a relation-b column-b)
    A relational equijoin, matching up `column-a' of `relation-a' with `column-b' of `relation-b'. For a binary relation, the columns are named 0 (domain) and 1 (range).
  • Method JOIN ((bra wb-2-relation) cola (brb wb-2-relation) colb)
  • Method COMPOSE ((rel wb-2-relation) (fn function))
  • Method COMPOSE ((rel wb-2-relation) (fn symbol))
  • Method COMPOSE ((rel wb-2-relation) (fn map))
  • Method COMPOSE ((rel wb-2-relation) (fn seq))
  • Method COMPOSE ((rel1 wb-2-relation) (rel2 wb-2-relation))
  • Macro DO-2-RELATION ((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 ((to-type (eql 'set)) (br 2-relation) &key (pair-fn #'cons))
  • Method CONVERT ((to-type (eql '2-relation)) (m map) &key from-type)
    If `from-type' is the symbol `map-to-sets', 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 ((to-type (eql 'wb-2-relation)) (m map) &key from-type)
    If `from-type' is the symbol `map-to-sets', 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 ((to-type (eql '2-relation)) (alist list) &key (key-fn #'car) (value-fn #'cdr))
  • Method CONVERT ((to-type (eql 'wb-2-relation)) (alist list) &key (key-fn #'car) (value-fn #'cdr))
  • Method CONVERT ((to-type (eql '2-relation)) (s seq) &key key-fn (value-fn #'identity))
  • Method CONVERT ((to-type (eql 'wb-2-relation)) (s seq) &key key-fn (value-fn #'identity))
  • Method CONVERT ((to-type (eql 'map)) (br wb-2-relation) &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 ((to-type (eql 'wb-map)) (br wb-2-relation) &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 ((to-type (eql 'map-to-sets)) (br wb-2-relation) &key)
    This conversion returns a map mapping each domain value to the set of corresponding range values.
  • Generic-Function CONFLICTS (2-relation)
    Returns a 2-relation containing only those pairs of `2-relation' whose domain value is mapped to multiple range values.
  • Method CONFLICTS ((br wb-2-relation))
  • Method ITERATOR ((rel wb-2-relation) &key)
  • Method COMPARE ((a wb-2-relation) (b wb-2-relation))
  • Macro 2-RELATION (&rest args)
    Constructs a 2-relation of the default implementation according to the supplied argument subforms. Each argument subform can be a list of the form (`key-expr' `value-expr'), denoting a mapping from the value of `key-expr' to the value of `value-expr'; or a list of the form ($ `expression'), in which case the expression must evaluate to a 2-relation, all of whose mappings will be included in the result. Also, each of 'key-expr' and 'value-expr' 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 (2-relation (($ (set 1 2)) ($ (set 'a 'b)))) contains the pairs <1, a>, <1, b>, <2, a>, and <2, b>.
  • Macro WB-2-RELATION (&rest args)
    Constructs a wb-2-relation according to the supplied argument subforms. Each argument subform can be a list of the form (`key-expr' `value-expr'), denoting a mapping from the value of `key-expr' to the value of `value-expr'; or a list of the form ($ `expression'), in which case the expression must evaluate to a 2-relation, all of whose mappings will be included in the result. Also, each of 'key-expr' and 'value-expr' 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 (wb-2-relation (($ (set 1 2)) ($ (set 'a 'b)))) contains the pairs <1, a>, <1, b>, <2, a>, and <2, b>.
  • Struct LIST-RELATION
    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 WB-LIST-RELATION
    A class of functional relations of arbitrary arity >= 2, whose tuples are in list form.
    ARITY
    TUPLES
    INDICES
  • Function EMPTY-LIST-RELATION (&optional arity)
    We allow the arity to be temporarily unspecified; it will be taken from the first tuple added, or the first query.
  • Function EMPTY-WB-LIST-RELATION (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 wb-list-relation))
    Will return `nil' if the arity is not yet specified; see `empty-list-relation'.
  • Method EMPTY? ((rel wb-list-relation))
  • Method SIZE ((rel wb-list-relation))
  • Method ARB ((rel wb-list-relation))
  • Method CONTAINS? ((rel wb-list-relation) tuple &optional (arg2 nil arg2?))
  • Generic-Function 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 wb-list-relation) (pattern list) (metapattern list))
  • Generic-Function QUERY-MULTI (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 QUERY-MULTI ((rel wb-list-relation) (pattern list) (metapattern list))
  • Method WITH ((rel wb-list-relation) tuple &optional (arg2 nil arg2?))
  • Method LESS ((rel wb-list-relation) tuple &optional (arg2 nil arg2?))
  • Macro DO-LIST-RELATION ((tuple rel &optional value) &body body)
  • Struct QUERY-REGISTRY
    ARITY
    INDICES
    KEY-INDEX
  • Function EMPTY-QUERY-REGISTRY (&optional arity)
  • Method ARITY ((reg query-registry))
  • Method WITH-QUERY ((reg query-registry) (pattern list) (metapattern list) query &optional arity)
  • Method LESS-QUERY ((reg query-registry) (pattern list) (metapattern list) query)
  • Method ALL-QUERIES ((reg query-registry))
  • Method LOOKUP ((reg query-registry) tuple)
    Returns all queries in `reg' whose patterns match `tuple'.
  • Method LOOKUP-MULTI ((reg query-registry) set-tuple)
    Here `set-tuple' 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 FORWARD-KEY ((reg query-registry) from-key to-key)
    Returns a new query-registry in which all queries whose patterns used `from-key' (in an instantiated position) now use `to-key' in that position instead.
  • Method LOOKUP-RESTRICTED ((reg query-registry) tuple key)
    Returns all queries in `reg' whose patterns match `tuple' and which use `key' (in an instantiated position) in their patterns.
  • Method LOOKUP-MULTI-RESTRICTED ((reg query-registry) set-tuple keys)
    Here `set-tuple' 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.
  • Generic-Function COMPLEMENT (set)
    Returns the complement of the set.
  • Method COMPLEMENT ((x function))
  • Method COMPLEMENT ((s set))
  • Method COMPLEMENT ((cs complement-set))
  • Method CONTAINS? ((cs complement-set) x &optional (y nil y?))
  • Method ARB ((cs complement-set))
  • Method SIZE ((cs complement-set))
  • Method WITH ((cs complement-set) x &optional (arg2 nil arg2?))
  • Method LESS ((cs complement-set) x &optional (arg2 nil arg2?))
  • Method UNION ((cs1 complement-set) (cs2 complement-set) &key)
  • Method UNION ((cs complement-set) (s set) &key)
  • Method UNION ((s set) (cs complement-set) &key)
  • Method INTERSECTION ((cs1 complement-set) (cs2 complement-set) &key)
  • Method INTERSECTION ((cs complement-set) (s set) &key)
  • Method INTERSECTION ((s set) (cs complement-set) &key)
  • Method SET-DIFFERENCE ((cs1 complement-set) (cs2 complement-set) &key)
  • Method SET-DIFFERENCE ((cs complement-set) (s set) &key)
  • Method SET-DIFFERENCE ((s set) (cs complement-set) &key)
  • Method SUBSET? ((cs1 complement-set) (cs2 complement-set))
  • Method SUBSET? ((cs complement-set) (s set))
  • Method SUBSET? ((s set) (cs complement-set))
  • Method DISJOINT? ((cs1 complement-set) (cs2 complement-set))
  • Method DISJOINT? ((cs complement-set) (s set))
  • Method DISJOINT? ((s set) (cs complement-set))
  • Method COMPARE ((cs1 complement-set) (cs2 complement-set))
  • Method COMPARE ((cs complement-set) (s set))
  • Method COMPARE ((s set) (cs complement-set))
  • Struct BOUNDED-SET
    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 MAKE-BOUNDED-SET (universe set &optional complement?)
  • Function BOUNDED-SET-CONTENTS (bs)
  • Method COMPLEMENT ((bs bounded-set))
  • Method EMPTY? ((bs bounded-set))
  • Method CONTAINS? ((bs bounded-set) x &optional (arg2 nil arg2?))
  • Method ARB ((bs bounded-set))
  • Method SIZE ((bs bounded-set))
  • Method WITH ((bs1 bounded-set) x &optional (arg2 nil arg2?))
  • Method LESS ((bs1 bounded-set) x &optional (arg2 nil arg2?))
  • Method UNION ((bs1 bounded-set) (bs2 bounded-set) &key)
  • Method INTERSECTION ((bs1 bounded-set) (bs2 bounded-set) &key)
  • Method SET-DIFFERENCE ((bs1 bounded-set) (bs2 bounded-set) &key)
  • Method SUBSET? ((bs1 bounded-set) (bs2 bounded-set))
  • Method DISJOINT? ((bs1 bounded-set) (bs2 bounded-set))
  • Method COMPARE ((bs1 bounded-set) (bs2 bounded-set))
  • Method COMPARE ((bs bounded-set) (s set))
  • Method COMPARE ((s set) (bs bounded-set))
  • Method CONVERT ((to-type (eql 'wb-set)) (bs bounded-set) &key)

FSET-USER

No exported symbols.