Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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".



Reassuring news. Thanks.


To 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".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: