Closed neverfox closed 10 years ago
This seems reasonable, but I'm wondering if exclude should just be use a.xor(b)[0]
a.intersect()
on each of the results of a.xor(b)
and toss the empties. I'd take pull a pull request either way.
Along similar lines, I'd love to add range.split(date*)
and range.split(interval)
.
Started the branch xor
, which a working implementation of xor().
Still needs support for all day ranges and tests for multiple inputs (since it allows for a.xor(b,c)
). I also started a couple other features on the same branch; I'll figure out what to do with them as I go.
It's in the develop branch. I switched from exclude
to difference
range1.difference(range2);
range1.xor(range2);
range1.difference(range2, range3, ...);
range1.xor(range2, range3, ...);
While I'm sure this can be built up with iterators, it would be great to have an
exclude
andxor
to complementunion
andintersection
, as seen here. Pretty much the first thing I thought of using twix for was an exclude, but it wasn't available. The problem, of course, is how to handle the fact that both can result in two ranges in certain cases. That's probably why it has been avoided. Any thoughts?