4 ms·
> Rust has "immutable variables". Seriously? How can an object be both variable and immutable? "Immutable variables" is frequently used, true, but the official
by AsyncAwait 10y ago
> Rust has "immutable variables". Seriously? How can an object be both variable and immutable?
"Immutable variables" is frequently used, true, but the official term is "immutable bindings".
- SQLite 10y agoReassuring news. Thanks.
- steveklabnik 10y agoTo elaborate slightly, there's three components here: let x = 5; let mut y = 6; The let statement binds a variable to a value: * x and y are the variables * 5 and 6 are values * let does the binding You can have an immutable binding, like x, or a mutable binding, like y. But most people turn "a bound variable" into "a variable" (or "an immutable variable") and "a mutably bound variable" into a "mutable variable".