Uh oh!
There was an error while loading. Please reload this page.
Update 'let is used to introduce variables' paragraph - #24149
Conversation
rust-highfive
commented
Apr 7, 2015
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
bombless
commented
Apr 7, 2015
Thanks for @jorisgio reminding me that the binding of But consider this: fnmain(){let(x,(y,));
x = 10;
y = true;}playpen I still suggest there's no "variable definition" in Rust. |
jorisgio
commented
Apr 7, 2015
In my opinion, in |
There was a problem hiding this comment.
there should be a newline after this, to make a new paragraph. also, the wrapping seems a bit odd.
steveklabnik
commented
Apr 7, 2015
The official term is 'variable bindings', though sometimes, people just say one or the other. |
There was a problem hiding this comment.
I would prefer to change this to "Why is let used to introduce variables?"
steveklabnik
commented
Apr 7, 2015
I do think this needs improvement and this is overall an improvement, just some nits :) |
bombless
commented
Apr 8, 2015
Thanks :) |
steveklabnik
commented
Apr 8, 2015
@bors: r+ rollup |
bors
commented
Apr 8, 2015
📌 Commit c9454b1 has been approved by |
I think "let is used to introduce variables" is incorrent.
You can use
```rust
match (42, true) {
(x, y) => { /* ... */ }
}
```
to replace
```rust
let x = 42;
let y = true;
```
so it's nothing special for `let`.There was a problem hiding this comment.
I missed a case here: for-in also do pattern matching.
I'll try update it.
I think "let is used to introduce variables" is incorrent.
You can use
to replace
so it's nothing special for
let.