Skip to content

Commit

Permalink
Update style-guide.md (#49216)
Browse files Browse the repository at this point in the history
* Update style-guide.md

I think the term "trivial anonymous function" is more memorable than `x -> f(x)`.

Co-authored-by: woclass <git@wo-class.cn>

---------

Co-authored-by: woclass <git@wo-class.cn>
  • Loading branch information
jonasaugust and inkydragon authored Apr 17, 2023
1 parent 1fff026 commit c9407bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/src/manual/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ You generally want to use [`isa`](@ref) and [`<:`](@ref) for testing types,
not `==`. Checking types for exact equality typically only makes sense when comparing to a known
concrete type (e.g. `T == Float64`), or if you *really, really* know what you're doing.

## Do not write `x->f(x)`
## Don't write a trivial anonymous function `x->f(x)` for a named function `f`

Since higher-order functions are often called with anonymous functions, it is easy to conclude
that this is desirable or even necessary. But any function can be passed directly, without being
Expand Down

0 comments on commit c9407bd

Please sign in to comment.