From c9407bd439fb4ee355b0d90c57d1195212751e49 Mon Sep 17 00:00:00 2001 From: Jonas August Date: Mon, 17 Apr 2023 17:10:14 -0400 Subject: [PATCH] Update style-guide.md (#49216) * Update style-guide.md I think the term "trivial anonymous function" is more memorable than `x -> f(x)`. Co-authored-by: woclass --------- Co-authored-by: woclass --- doc/src/manual/style-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/manual/style-guide.md b/doc/src/manual/style-guide.md index cbe7e9b94eefc..d250fdd811387 100644 --- a/doc/src/manual/style-guide.md +++ b/doc/src/manual/style-guide.md @@ -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