Skip to content

Commit f4efa74

Browse files
committed
clean up docstring wording
1 parent 306a0bd commit f4efa74

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

base/runtime_internals.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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
201201
julia> function make_fib()
@@ -208,10 +208,10 @@ julia> make_fib()(7)
208208
21
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
217217
julia> factorial = n -> n <= 1 ? 1 : n * (@__FUNCTION__)(n - 1);
@@ -220,7 +220,7 @@ julia> factorial(5)
220220
120
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
224224
enclosing function:
225225
226226
```jldoctest

0 commit comments

Comments
 (0)