No description
Find a file
2021-03-10 23:29:26 +01:00
src Initial commit 2021-03-10 23:29:26 +01:00
tests Initial commit 2021-03-10 23:29:26 +01:00
intervalsets.nimble Initial commit 2021-03-10 23:29:26 +01:00
LICENSE Initial commit 2021-03-10 23:29:26 +01:00
README.md Initial commit 2021-03-10 23:29:26 +01:00

intervalsets

Implementation of a set of disjoint intervals.

Usage

var s = toIntervalSet({'A'..'Z', 'a'..'z'})
echo s # {'A'..'Z', 'a'..'z'}
excl(s, 'e'..'f')
echo s # {'A'..'Z', 'a'..'d', 'g'..'z'}
incl(s, 'e')
echo s # {'A'..'Z', 'a'..'e', 'g'..'z'}

echo toIntervalSet([0..0, 2..4, 5..6]) # {0, 2..6}