Language support for chained comparison operators (x < y < z)

It should be more common, but I suspect it is not because it makes parsing languages more complex. Benefits: Upholds the principle of least surprise Reads like math is taught Reduces cognitive load (see previous 2 points) Drawbacks: Grammar is more complex for the language Special case syntactic sugar As to why not, my guesses … Read more

What is the ..= (dot dot equals) operator in Rust?

This is the inclusive range operator. The range x..=y contains all values >= x and <= y, i.e. “from x up to and including y”. This is in contrast to the non-inclusive range operator x..y, which doesn’t include y itself. fn main() { println!(“{:?}”, (10..20) .collect::<Vec<_>>()); println!(“{:?}”, (10..=20).collect::<Vec<_>>()); } // Output: // // [10, 11, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)