Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification of let variables declarations #3453

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ch03-01-variables-and-mutability.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ be annotated. We’ll cover types and type annotations in the next section,
right now. Just know that you must always annotate the type.

Constants can be declared in any scope, including the global scope, which makes
them useful for values that many parts of code need to know about.
them useful for values that many parts of code need to know about. This is in
contrast to variables declared with the `let` keyword, which cannot be declared
in the global scope.

The last difference is that constants may be set only to a constant expression,
not the result of a value that could only be computed at runtime.
Expand Down