Handbook
Glossary
<interval-set> ( specification -- interval-set )
Interval sets
Prev:
interval-set
Next:
interval-in? ( key set -- ? )
Vocabulary
interval-sets
Inputs
specification
a sequence of numbers and pairs of numbers
Outputs
interval-set
an
interval-set
Word description
Creates an interval set based on the specification. Pairs of numbers are interpreted as intervals which include their endpoints, and individual numbers are interpreted to be in the set, in a singleton range.
Definition
USING:
interval-sets.private
sorting
;
IN:
interval-sets
:
<interval-set>
( specification -- interval-set )
spec>pairs
sort-keys
>intervals
make-intervals
;