diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-11 17:50:24 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-11 18:01:06 -0700 |
commit | 507e58bef8dd7d0a77247e85d3180313d44bc45e (patch) | |
tree | d22bbceac25939d44268b3d7c5dae8560f3cc994 /08-expressions.md | |
parent | 09c957bef7b063353add3c04a9e0568aeed1eb30 (diff) | |
download | scala-507e58bef8dd7d0a77247e85d3180313d44bc45e.tar.gz scala-507e58bef8dd7d0a77247e85d3180313d44bc45e.tar.bz2 scala-507e58bef8dd7d0a77247e85d3180313d44bc45e.zip |
github markdown: tables
Diffstat (limited to '08-expressions.md')
-rw-r--r-- | 08-expressions.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/08-expressions.md b/08-expressions.md index 4adf23c63e..8331bcaa1c 100644 --- a/08-expressions.md +++ b/08-expressions.md @@ -438,12 +438,13 @@ parameterlist `()`. The method values in the left column are each equivalent to the [anonymous functions](#anonymous-functions) on their 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)` | -|------------------------------ | --------------------------------------------| + 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. @@ -1292,6 +1293,7 @@ $e'$ results from $e$ by replacing each underscore section $u_i$ by $u_i'$. The anonymous functions in the left column use placeholder syntax. Each of these is equivalent to the anonymous function on its right. +| | | |---------------------------|----------------------------| |`_ + 1` | `x => x + 1` | |`_ * _` | `(x1, x2) => x1 * x2` | @@ -1299,7 +1301,6 @@ syntax. Each of these is equivalent to the anonymous function on its right. |`if (_) x else y` | `z => if (z) x else y` | |`_.map(f)` | `x => x.map(f)` | |`_.map(_ + 1)` | `x => x.map(y => y + 1)` | -|---------------------------|----------------------------| ## Constant Expressions |