Skip to content

Commit

Permalink
Merge pull request #1269 from guoci/patch-1
Browse files Browse the repository at this point in the history
Update closure-expr.md
  • Loading branch information
Havvy committed Sep 13, 2022
2 parents 18d13e7 + 04ce4c4 commit 6630924
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/expressions/closure-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
> _ClosureParam_ :\
> &nbsp;&nbsp; [_OuterAttribute_]<sup>\*</sup> [_PatternNoTopAlt_]&nbsp;( `:` [_Type_] )<sup>?</sup>
A *closure expression*, also know as a lambda expression or a lambda, defines a [closure type] and evaluates to a value of that type.
A *closure expression*, also known as a lambda expression or a lambda, defines a [closure type] and evaluates to a value of that type.
The syntax for a closure expression is an optional `move` keyword, then a pipe-symbol-delimited (`|`) comma-separated list of [patterns], called the *closure parameters* each optionally followed by a `:` and a type, then an optional `->` and type, called the *return type*, and then an expression, called the *closure body operand*.
The optional type after each pattern is a type annotation for the pattern.
If there is a return type, the closure body must be a [block].
Expand Down

0 comments on commit 6630924

Please sign in to comment.