3 ms·
I prefer explicit words over symbols, like in Scala: scala> 1 to 3 scala.collection.immutable.Range.Inclusive = Range(1, 2, 3) scala> 1 until 3 scala.collec
by desdiv 9y ago
I prefer explicit words over symbols, like in Scala:
scala> 1 to 3
scala.collection.immutable.Range.Inclusive = Range(1, 2, 3)
scala> 1 until 3
scala.collection.immutable.Range = Range(1, 2)
- Cyph0n 9y agoAgreed, Scala's approach to ranges is one of the best out there from my experience.
- menage 9y agoAs someone who's never programmed in Scala, it's not intuitive to me at all that "until" means exclusive, given that "to" (which is basically a synonym) means inclusive.
- lauritzsh 9y agoHow would you feel about > 1 through 3 # [1, 2, 3] > 1 until 3 # or 1 to 3 # [1, 2] as explicit word range notation?