4 ms·
Indeed a clear syntax. OTOH, a "loop .. for .. {upto, below} count" leaves less questions in a casual code review :)
by jlg23 9y ago
Indeed a clear syntax.
OTOH, a "loop .. for .. {upto, below} count" leaves less questions in a casual code review :)
- desdiv 9y agoI 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?