From e508ad61f9ec8f471bc3b757814dca9ef46219fb Mon Sep 17 00:00:00 2001 From: nathanknox <32739103+nathanknox@users.noreply.github.com> Date: Thu, 19 Dec 2019 15:03:54 -0500 Subject: [PATCH] Update anonymous-functions.md It looks like there are two examples where you're intending to refer to a `List` named `ints` but have referred to it as `list` instead. I thought some might find this confusing, so I have changed those two instances to refer to `ints` instead. --- _overviews/scala-book/anonymous-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_overviews/scala-book/anonymous-functions.md b/_overviews/scala-book/anonymous-functions.md index c8e1b4942b..b8e7fdd0cb 100644 --- a/_overviews/scala-book/anonymous-functions.md +++ b/_overviews/scala-book/anonymous-functions.md @@ -77,9 +77,9 @@ val doubledInts = ints.map((i: Int) => i * 2) val doubledInts = ints.map(i => i * 2) ``` -All three lines have exactly the same meaning: Double each element in `list` to create a new list, `doubledInts`. +All three lines have exactly the same meaning: Double each element in `ints` to create a new list, `doubledInts`. ->The `_` character in Scala is something of a wildcard character. You’ll see it used in several different places. In this case it’s a shorthand way of saying, “An element from the list, `list`.” +>The `_` character in Scala is something of a wildcard character. You’ll see it used in several different places. In this case it’s a shorthand way of saying, “An element from the list, `ints`.” Before going any further, it’s worth mentioning that this `map` example is the equivalent of this Java code: