Clarify function definitions vs. expressions

Fixes #2980.
This commit is contained in:
Chris Krycho 2024-03-04 12:22:37 -07:00
parent 19c40bfd2d
commit b411d7072e
1 changed files with 2 additions and 1 deletions

View File

@ -125,7 +125,8 @@ assigning a value to it with the `let` keyword is a statement. In Listing 3-1,
<span class="caption">Listing 3-1: A `main` function declaration containing one statement</span>
Function definitions are also statements; the entire preceding example is a
statement in itself.
statement in itself. As we will see below, *calling* a function is an
expression.
Statements do not return values. Therefore, you cant assign a `let` statement
to another variable, as the following code tries to do; youll get an error: