AdventOfCode reminded me of functionality I have w...
# language-proposals
m
AdventOfCode reminded me of functionality I have wanted in my enterprise software: Multiranges. Or at least the concept of having ranges with functionality for combining them. I want to be able to do Range.overlap(range: Range) and get a new range with just the part that overlaps. Or a multirange that can collect ranges and return the minimal multirange that contains all ranges. e.g.
Copy code
1..3 + 2..4 + 6..8 = Multirange(1..4, 6..8)
psql has similar functionality that I already use, but on the kotlin side I need way more work to make this work
j
This isn't a language feature but one of #stdlib. Also that operation is typically called an "intersection" because you're describing set theory.