You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice how it has a ..= pattern which it refers to as half open, even though ..= is never considered half open in rustc.
range
rustc terminology
reference terminology
lo..
half open
half open
..=hi
closed (opposite of half open)
half open (!)
lo..=hi
closed
inclusive
Do we know whether one of these uses of the "half open" terminology is more preferred? Might we reach agreement about which of rustc or the reference should be changed?
The text was updated successfully, but these errors were encountered:
Oh, hello. Sorry, somehow missed this amidst my notifications. I am fine with the chosen resolution. I believe I flubbed what might have been intended to be a usage of "half-closed" there.
In dtolnay/syn#1373 I noticed an inconsistency between how ranges are described in the reference vs how the compiler uses the same terminology.
Rustc has the following enum which distinguishes
..
vs..=
in range patterns and expressions:https://github.com/rust-lang/rust/blob/1.67.0/compiler/rustc_ast/src/ast.rs#L1323-L1328
Ranges in rustc are effectively
(Option<Expr>, RangeLimits, Option<Expr>)
.Meanwhile a different approach is currently taken by the Rust Reference: https://doc.rust-lang.org/1.67.0/reference/patterns.html#range-patterns
Notice how it has a
..=
pattern which it refers to as half open, even though..=
is never considered half open in rustc.lo..
..=hi
lo..=hi
Do we know whether one of these uses of the "half open" terminology is more preferred? Might we reach agreement about which of rustc or the reference should be changed?
The text was updated successfully, but these errors were encountered: