Skip to content

Commit 5181e36

Browse files
authored
document behavior of keywords in dot calls (#44033)
1 parent e623275 commit 5181e36

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/src/manual/functions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,9 @@ julia> f.(A, B)
993993
33.0
994994
```
995995

996+
Keyword arguments are not broadcasted over, but are simply passed through to each call of
997+
the function. For example, `round.(x, digits=3)` is equivalent to `broadcast(x -> round(x, digits=3), x)`.
998+
996999
Moreover, *nested* `f.(args...)` calls are *fused* into a single `broadcast` loop. For example,
9971000
`sin.(cos.(X))` is equivalent to `broadcast(x -> sin(cos(x)), X)`, similar to `[sin(cos(x)) for x in X]`:
9981001
there is only a single loop over `X`, and a single array is allocated for the result. [In contrast,

0 commit comments

Comments
 (0)