# Namespace: joker.set

v1.0

## Contents

- Summary
- Index
- Constants
- Variables
- Functions, Macros, and Special Forms

## Summary

Set operations such as union/intersection.

## Index

- difference
- index
- intersection
- join
- map-invert
- project
- rename
- rename-keys
- select
- subset?
- superset?
- union

## Constants

Constants are variables with `:const true` in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.

(None.)

## Variables

(None.)

## Functions, Macros, and Special Forms

- ### difference

  Function v1.0

      (difference s1)
      (difference s1 s2)
      (difference s1 s2 & sets)

  Return a set that is the first set without elements of the remaining sets

  source

- ### index

  Function v1.0

      (index xrel ks)

  Returns a map of the distinct values of ks in the xrel mapped to a
  set of the maps in xrel with the corresponding values of ks.

  source

- ### intersection

  Function v1.0

      (intersection s1)
      (intersection s1 s2)
      (intersection s1 s2 & sets)

  Return a set that is the intersection of the input sets

  source

- ### join

  Function v1.0

      (join xrel yrel)
      (join xrel yrel km)

  When passed 2 rels, returns the rel corresponding to the natural
  join. When passed an additional keymap, joins on the corresponding
  keys.

  source

- ### map-invert

  Function v1.0

      (map-invert m)

  Returns the map with the vals mapped to the keys.

  source

- ### project

  Function v1.0

      (project xrel ks)

  Returns a rel of the elements of xrel with only the keys in ks

  source

- ### rename

  Function v1.0

      (rename xrel kmap)

  Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap

  source

- ### rename-keys

  Function v1.0

      (rename-keys map kmap)

  Returns the map with the keys in kmap renamed to the vals in kmap

  source

- ### select

  Function v1.0

      (select pred xset)

  Returns a set of the elements for which pred is true

  source

- ### subset?

  Function v1.0

      (subset? set1 set2)

  Is set1 a subset of set2?

  source

- ### superset?

  Function v1.0

      (superset? set1 set2)

  Is set1 a superset of set2?

  source

- ### union

  Function v1.0

      (union)
      (union s1)
      (union s1 s2)
      (union s1 s2 & sets)

  Return a set that is the union of the input sets

  source