3 ms·
So... you prefer Lua because half-open ranges confuse you?
by masklinn 15y ago
So... you prefer Lua because half-open ranges confuse you?
- sesqu 15y agoIf we're going for half-open ranges, range(n) ≝ 0<i≤n would make more sense than 0≤i<n. But then again, sign(0) is still a point of disagreement today. Dijkstra argued against this by noting that that makes adding 0 to the range impractical, but then he was considering natural numbers, not the half-open ranges we're talking about and using notation for here. Me, I prefer integers and the a..b style, despite the off-by-one error.