basilisp.set¶
Set manipulation utilities.
- fn (difference s)[source]¶
- 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)[source]¶
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)[source]¶
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)[source]¶
- 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)[source]¶
- 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)[source]¶
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)[source]¶
Given a set of maps
rel
, return a set of those maps with only the keys inks
.
- fn (rename rel kmap)[source]¶
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)[source]¶
Return
m
with any keys appearing inkmap
replaced with the value inkmap
.