diff --git a/Functions.Rmd b/Functions.Rmd index e7e926ef9..b81a1b740 100644 --- a/Functions.Rmd +++ b/Functions.Rmd @@ -567,6 +567,8 @@ A promise has three components: y ``` + Note that doing the above is generally considered bad style since – due to the nature of lazy evaluation – there is no guarantee that the argument will ever be evaluated and hence the assignment may never take place.[^off-doc-argeval] + * A value, which is computed and cached the first time a promise is accessed when the expression is evaluated in the specified environment. This ensures that the promise is evaluated at most once, and is why you @@ -587,6 +589,7 @@ A promise has three components: You cannot manipulate promises with R code. Promises are like a quantum state: any attempt to inspect them with R code will force an immediate evaluation, making the promise disappear. Later, in Section \@ref(quosures), you'll learn about quosures, which convert promises into an R object where you can easily inspect the expression and the environment. +[^off-doc-argeval]: See [chapter 4.3.3 _Argument evaluation_](https://cran.r-project.org/doc/manuals/r-release/R-lang.html#Argument-evaluation) of the official R language definition for some more information about the topic. ### Default arguments \index{functions!default values}