Skip to content

Commit f19590d

Browse files
committed
---
yaml --- r: 63111 b: refs/heads/snap-stage3 c: 1cf57f7 h: refs/heads/master i: 63109: 28a8a3a 63107: 6d35e29 63103: cd6fe44 v: v3
1 parent a63a575 commit f19590d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 88517f98743a5cbaaa818376eea77229da3c8453
4+
refs/heads/snap-stage3: 1cf57f7b673ca94a32ec82c31b2bce79a5ca9394
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/tutorial.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,10 +1442,15 @@ call_closure_with_ten(closure);
14421442
~~~~
14431443

14441444
Closures begin with the argument list between vertical bars and are followed by
1445-
a single expression. The types of the arguments are generally omitted,
1446-
as is the return type, because the compiler can almost always infer
1447-
them. In the rare case where the compiler needs assistance, though, the
1448-
arguments and return types may be annotated.
1445+
a single expression. Remember that a block, `{ <expr1>; <expr2>; ... }`, is
1446+
considered a single expression: it evaluates to the result of the last
1447+
expression it contains if that expression is not followed by a semicolon,
1448+
otherwise the block evaluates to `()`.
1449+
1450+
The types of the arguments are generally omitted, as is the return type,
1451+
because the compiler can almost always infer them. In the rare case where the
1452+
compiler needs assistance, though, the arguments and return types may be
1453+
annotated.
14491454

14501455
~~~~
14511456
let square = |x: int| -> uint { x * x as uint };

0 commit comments

Comments
 (0)