summaryrefslogtreecommitdiff
path: root/08-expressions.md
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-03-12 17:59:33 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-03-12 17:59:33 -0700
commit51f3ac1f36737606a2921a2abca39c1ca7962324 (patch)
tree90afbca2a6c9ca917cc19523b37f0c8c6e6769e1 /08-expressions.md
parent78d96eafe9c7404b43da38892134ba380dd77db5 (diff)
downloadscala-51f3ac1f36737606a2921a2abca39c1ca7962324.tar.gz
scala-51f3ac1f36737606a2921a2abca39c1ca7962324.tar.bz2
scala-51f3ac1f36737606a2921a2abca39c1ca7962324.zip
SI-6054 correct eta-expansion in method value using placeholder syntax
Diffstat (limited to '08-expressions.md')
-rw-r--r--08-expressions.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/08-expressions.md b/08-expressions.md
index 1eed192cc8..e951350fb3 100644
--- a/08-expressions.md
+++ b/08-expressions.md
@@ -433,21 +433,21 @@ parameterless method or call-by-name parameter of type
parameterlist `()`.
###### Example
-The method values in the left column are each equivalent to the
-[anonymous functions](#anonymous-functions) on their right.
+The method values in the left column are each equivalent to the [eta-expanded expressions](#eta-expansion) on the right.
| | |
|------------------------------ | --------------------------------------------|
|`Math.sin _` | `x => Math.sin(x)` |
|`Array.range _` | `(x1, x2) => Array.range(x1, x2)` |
|`List.map2 _` | `(x1, x2) => (x3) => List.map2(x1, x2)(x3)` |
-|`List.map2(xs, ys)_` | `x => List.map2(xs, ys)(x)` |
+|`List.map2(xs, ys)_` | `{ val eta1 = xs; val eta2 = ys; x => List.map2(eta1, eta2)(x) }` |
Note that a space is necessary between a method name and the trailing underscore
because otherwise the underscore would be considered part of the name.
+
## Type Applications
```