Y
Hacker News
new
|
ask
|
show
|
jobs
by
jamiejquinn
229 days ago
I completely agree. One of Zig's big competitors, Odin, has a more explicit syntax for this where `0..<5` is an open interval and `0...5` is closed.
3 comments
brabel
229 days ago
I think that comes from Ruby, right? I know Groovy is inspired by Ruby and has exactly the same syntax.
EDIT: oh just noticed it's 3 dots in the close case... in Groovy it's just 2.
link
thegeekpirate
229 days ago
Odin's even better than that—you can only use `0..<5` and `0..=5`, so there's never any ambiguity whatsoever.
link
psnehanshu
229 days ago
I even forget which word means what, "open", "close"
link
EDIT: oh just noticed it's 3 dots in the close case... in Groovy it's just 2.