@@ -163,13 +163,17 @@ This is to make the language easier to parse for humans, especially in the face
163163of higher-order functions. ` fn foo<T>(f: fn(int): int, fn(T): U): U ` is not
164164particularly easy to read.
165165
166- ## ` let ` is used to introduce variables
167-
168- ` let ` not only defines variables, but can do pattern matching. One can also
169- redeclare immutable variables with ` let ` . This is useful to avoid unnecessary
170- ` mut ` annotations. An interesting historical note is that Rust comes,
171- syntactically, most closely from ML, which also uses ` let ` to introduce
172- bindings.
166+ ## How to introduce variables?
167+
168+ We don't use the term variable, instead we use bindings.
169+ The simplest way for binding is the ` let ` syntax, other ways including
170+ ` if let ` , ` while let ` and ` match ` . Bindings also exist in function arguments
171+ positions.
172+ Bindings always happen in pattern matching positions, and it's also Rust's way
173+ to declare mutability. One can also redeclare mutability of a binding in pattern
174+ matching. This is useful to avoid unnecessary ` mut ` annotations. An interesting
175+ historical note is that Rust comes, syntactically, most closely from ML, which
176+ also uses ` let ` to introduce bindings.
173177
174178See also [ a long thread] [ alt ] on renaming ` let mut ` to ` var ` .
175179
0 commit comments