From b411d7072e763be6715b767a951c5e9de04c6c39 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Mon, 4 Mar 2024 12:22:37 -0700 Subject: [PATCH] Clarify function definitions vs. expressions Fixes #2980. --- src/ch03-03-how-functions-work.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ch03-03-how-functions-work.md b/src/ch03-03-how-functions-work.md index 2b59f0cd45..6f9b6a3e1a 100644 --- a/src/ch03-03-how-functions-work.md +++ b/src/ch03-03-how-functions-work.md @@ -125,7 +125,8 @@ assigning a value to it with the `let` keyword is a statement. In Listing 3-1, Listing 3-1: A `main` function declaration containing one statement 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 can’t assign a `let` statement to another variable, as the following code tries to do; you’ll get an error: