@@ -181,7 +181,7 @@ _function_macro_error() = (@noinline; error("@__FUNCTION__ can only be used with
181181Get the innermost enclosing function object.
182182
183183!!! note
184- In functions like `f() = [@__FUNCTION__ for _ in 1:10]`, this would
184+ In functions like `f() = [( @__FUNCTION__) for _ in 1:10]`, this would
185185 refer to the generator function in the comprehension, NOT the enclosing
186186 function `f`. Similarly, in a closure function, this will refer to the
187187 closure function object rather than the enclosing function. Note that
@@ -195,7 +195,7 @@ Get the innermost enclosing function object.
195195# Examples
196196
197197`@__FUNCTION__` is useful for closures that need to refer to themselves,
198- as otherwise the function object itself would be a variable and would be boxed:
198+ as otherwise the function object would be captured as a variable and boxed.
199199
200200```jldoctest
201201julia> function make_fib()
@@ -208,10 +208,10 @@ julia> make_fib()(7)
20820821
209209```
210210
211- If we had instead written `fib(n) = n <= 1 ? 1 : fib(n - 1) + fib(n - 2)`
212- for the closure function, `fib` would be treated as a variable, and be boxed .
211+ If we had instead used `fib(n - 1) + fib(n - 2)` directly, `fib` would be boxed,
212+ leading to type instabilities .
213213
214- Note that `@__FUNCTION__` is available for anonymous functions:
214+ Note that `@__FUNCTION__` is also available for anonymous functions:
215215
216216```jldoctest
217217julia> factorial = n -> n <= 1 ? 1 : n * (@__FUNCTION__)(n - 1);
@@ -220,7 +220,7 @@ julia> factorial(5)
220220120
221221```
222222
223- `@__FUNCTION__` can also be combined with `nameof` to get the symbol of the
223+ `@__FUNCTION__` can also be combined with `nameof` to get the symbol for an
224224enclosing function:
225225
226226```jldoctest
0 commit comments