On Wed Jan 28, 2026 at 9:17 AM CET, Alexandre Courbot wrote: > On Wed Jan 28, 2026 at 1:35 PM JST, Eliot Courtney wrote: >> On Tue Jan 27, 2026 at 3:04 AM JST, Gary Guo wrote: >>> I wonder if this can be `is within 0..MSGQ_NUM_PAGES`. What do others think? >> >> I think this is very reasonable, since this is part of the rust >> range syntax so it should be understandable. I also considered the >> mathematical syntax `[0, MSGQ_NUM_PAGES)`, but not sure if this would >> be conventional - it does seem that this notation is used in a bunch >> of places though. Will apply your suggestion in the next version unless >> there is a definitive convention for this. > > Since this is Rust code, the Rust syntax to express ranges (within `` > quotes) makes sense IMHO.
While I really like the mathematical syntax, I think using the Rust syntax is superior, as it requires zero mental cycles to translate it to what is likely to be found in the code as well. (There also have been some considerations of using tools to validate safety comments or invariants to some extend eventually.)
