basilisp.set
Set manipulation utilities.
- fn (difference s)
- fn (difference s & others)
Return a new set with elements from set
s
not in theothers
. If no others are provided, returns
.
- fn (disjoint? s1 s2)
Return true if set
s1
shares no common elements with sets2
.Sets are considered disjoint if and only if their intersection is the empty set.
- fn (index rel ks)
Given a set of maps
rel
, return a mapping of unique selections of keys fromks
to the set of values which have those mappings.
- fn (intersection s)
- fn (intersection s & others)
Return a new set with only elements in set
s
that are in all theothers
. If no others are provided, returns
.
- fn (join lrel rrel)
- fn (join lrel rrel keymap)
Perform a natural join on the maps in
lrel
andrrel
using keys shared by elements of each relation. Ifkeymap
is specified, join only on the given keys.
- fn (map-invert m)
Return a map whose vals and keys are swapped.
Duplicate values used as keys will overwrite each other as iteration order is non-deterministic.
- fn (project rel ks)
Given a set of maps
rel
, return a set of those maps with only the keys inks
.
- fn (rename rel kmap)
Given a set of maps
rel
, return a set whose maps have had any keys inkmap
renamed to the value inkmap
.
- fn (rename-keys m kmap)
Return
m
with any keys appearing inkmap
replaced with the value inkmap
.
- fn (select pred xset)
Return a set of values in
xset
for whichpred
is true.
- fn (subset? s1 s2)
Return true if every element in
s1
is also ins2
.
- fn (superset? s1 s2)
Return true if every element in
s2
is also ins1
.
- fn (symmetric-difference s)
- fn (symmetric-difference s & others)
Return a new set with elements which are not shared by any of the set
s
andothers
. If no others are provided, returns
.
- fn (union s)
- fn (union s & others)
Return a new set with elements in set
s
that are in theothers
. If no others are provided, returns
.