Conversation

I like Swift's `a..b` and `a..<b`. Rust got it round the wrong way. If you want to use the equals sign then I only accept `a=..=b` and `a=..<b`, but now it looks like I've got weird smileys everywhere.
1
1
I would love to see a gradual migration in Rust to Swift's approach over multiple editions (via your proposal), but I doubt there's any energy to spare for that.
1
Because asymmetrical ranges should use an asymmetrical operator. Symmetrical ranges should be symmetrical. It's likely I could be a weirdo though and maybe if I thought more about it I'd feel less strongly. 😅
1
Replying to
My experience is that half-open ranges are most useful for slicing and closed ranges are most useful for matching/parsing. For example, you it's not even obvious how one would represent 'a'..'z' (the class of english alphabet characters) with a half-open interval.
1
2