Version: 5.1
21 Sets
(require unstable/set) |
This library is unstable;
compatibility will not be maintained.
See Unstable for more information.
This module provides tools for representing finite sets.
| ||
| ||
|
Produces the appropriate type of set containing the elements of the given list.
Examples: | ||||
| ||||
> (list->set lst) | ||||
#<set: atom (compound) 1267650600228229401496703205376> | ||||
> (list->seteqv lst) | ||||
#<seteqv: atom (compound) (compound) 1267650600228229401496703205376> | ||||
> (list->seteq lst) | ||||
#<seteq: atom (compound) (compound) 1267650600228229401496703205376 1267650600228229401496703205376> |
Reports whether two sets contain the same elements.
Examples: |
> (set=? (set 1) (set 1 2 3)) |
#f |
> (set=? (set 1 2 3) (set 1)) |
#f |
> (set=? (set 1 2 3) (set 1 2 3)) |
#t |
(proper-subset? a b) → boolean? |
a : set? |
b : set? |
Reports whether b contains all of the elements of a, and at
least one element not in a.
Examples: |
> (proper-subset? (set 1) (set 1 2 3)) |
#t |
> (proper-subset? (set 1 2 3) (set 1)) |
#f |
> (proper-subset? (set 1 2 3) (set 1 2 3)) |
#f |
Produces a list containing the elements of s.
Example: |
> (set->list (set 1 2 3)) |
'(1 2 3) |
(set-exclusive-or s ...+) → set? |
s : set? |
Produces a set containing only those elements found in each s an odd
number of times.
Example: |
> (set-exclusive-or (set 1) (set 1 2) (set 1 2 3)) |
#<set: 1 3> |