Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 320 Bytes

File metadata and controls

14 lines (12 loc) · 320 Bytes

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}