You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/modules/language-guide/pages/language-manual.adoc
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -788,7 +788,7 @@ The `Null` type has a single value, the literal `null`. `Null` is a subtype of t
788
788
[[option-types]]
789
789
=== Option types
790
790
791
-
`? <typ>` specifies the type of values that are either `null` or a proper value of the form `? <v>` where `<v>` has type `typ`.
791
+
`? <typ>` specifies the type of values that are either `null` or a proper value of the form `? <v>` where `<v>` has type `<typ>`.
792
792
793
793
[[function-types]]
794
794
=== Function types
@@ -1078,14 +1078,14 @@ Multiple imports of the same library can be safely deduplicated without loss of
1078
1078
1079
1079
An import `import <id>? =? <url>` declares an optional identifier `<id>?` bound to the contents of the text literal `<url>`. (`<id>?`, when absent, defaults to some fresh identifier `<id>`.)
1080
1080
1081
-
`<url>` is a text literal that designates some resource: a local library specified with a relative path, a named module from a named package,
1081
+
`<url>` is a text literal that designates some resource: a local library specified with a relative path, a named module from a named package,
1082
1082
or an external canister, referenced either by numeric canister id or by a named alias, and imported as a {proglang} actor.
1083
1083
1084
1084
In detail, if `<url>` is of the form:
1085
1085
1086
1086
* `"<filepath>"` then `<id>` is bound to the library module defined in file `<filepath>.mo`.
1087
1087
`<filepath>` is interpreted relative to the absolute location of the enclosing file.
1088
-
Note the `.mo` extension is implicit and should *not* be included in `<url>`.
1088
+
Note the `.mo` extension is implicit and should *not* be included in `<url>`.
1089
1089
For example, `import U "lib/Util"` defines `U` to reference the module in local file
1090
1090
`./lib/Util`.
1091
1091
@@ -1438,7 +1438,7 @@ The unary operator `<unop> <exp>` has type `T` provided:
1438
1438
* `<exp>` has type `T`, and
1439
1439
* The category of `<unop>` is a category of `T`.
1440
1440
1441
-
The unary operator expression `<unop> <exp>` evaluates `exp` to a result. If the result is a value `v`, it returns the result of `<unop> v`.
1441
+
The unary operator expression `<unop> <exp>` evaluates `<exp>` to a result. If the result is a value `v`, it returns the result of `<unop> v`.
1442
1442
If the result is `trap`, the entire expression results in `trap`.
1443
1443
1444
1444
[[binary-operators]]
@@ -1487,7 +1487,7 @@ The tuple expression `(<exp1>, ..., <expn>)` evaluates the expressions `exp1` ..
1487
1487
The tuple projection `<exp> . <nat>` has type `Ti` provided `<exp>` has tuple type
1488
1488
`(T1, ..., Ti, ..., Tn)`, `<nat>` == `i` and `1 \<= i \<= n`.
1489
1489
1490
-
The projection `<exp> . <nat>` evaluates `exp` to a result `r`. If `r` is `trap`, then the result is `trap`. Otherwise, `r` must be a tuple `(v1,...,vi,...,vn)` and the result of the projection is the value `vi`.
1490
+
The projection `<exp> . <nat>` evaluates `<exp>` to a result `r`. If `r` is `trap`, then the result is `trap`. Otherwise, `r` must be a tuple `(v1,...,vi,...,vn)` and the result of the projection is the value `vi`.
1491
1491
1492
1492
The empty tuple expression `()` is called the *unit value*.
1493
1493
@@ -1506,7 +1506,7 @@ The variant injection `# <id> <exp>` has variant type `{# id T}` provided:
1506
1506
1507
1507
The variant injection `# <id>` is just syntactic sugar for `# <id> ()`.
1508
1508
1509
-
The variant injection`# <id> <exp>` evaluates `exp` to a result `r`. If `r` is `trap`, then the result is `trap`.
1509
+
The variant injection`# <id> <exp>` evaluates `<exp>` to a result `r`. If `r` is `trap`, then the result is `trap`.
1510
1510
Otherwise, `r` must be a value `v` and the result of the injection is the tagged value `# <id> v`.
1511
1511
1512
1512
The tag and contents of a variant value can be tested and accessed using a <<pat-variant,variant pattern>>.
@@ -1527,7 +1527,7 @@ Such an object literal is equivalent to the object declaration `object { <dec-fi
1527
1527
The object projection `<exp> . <id>` has type `var? T` provided `<exp>` has object type
The projection `<exp> . <id>` evaluates `exp` to a result `r`.
1560
+
The projection `<exp> . <id>` evaluates `<exp>` to a result `r`.
1561
1561
If `r` is `trap`, then the result is `trap`.
1562
1562
Otherwise, `r` must be a value of type `U` and the result of the projection is a value of type `T`
1563
1563
whose semantics is given by the Description column of the previous table.
@@ -1659,7 +1659,7 @@ Otherwise, `r1` is a function value, `<shared-pat>? func <X0 <: V0, ..., n <: Vn
1659
1659
If `<shared-pat>` is present and of the form `shared query? <pat>` then evaluation continues by matching the record value `{caller = p}` against `<pat>`, where `p`
1660
1660
is the `Principal` invoking the function (typically a user or canister).
1661
1661
Matching continues by matching `v1` against `<pat1>`.
1662
-
If pattern matching succeeds with some bindings, then evaluation returns the result of `exp` in the environment of the function value (not shown) extended with those bindings.
1662
+
If pattern matching succeeds with some bindings, then evaluation returns the result of `<exp>` in the environment of the function value (not shown) extended with those bindings.
1663
1663
Otherwise, some pattern match has failed and the call results in `trap`.
1664
1664
1665
1665
Note: the exhaustiveness side condition on `shared` function expressions ensures that argument pattern matching cannot fail (see <<exp-func>>).
@@ -1890,7 +1890,7 @@ The expression `return <exp>` has type `None` provided:
1890
1890
* `T` is the return type of the nearest enclosing function (with no intervening `async` expression), or
1891
1891
* `async T` is the type of the nearest enclosing (perhaps implicit) `async` expression (with no intervening function declaration)
1892
1892
1893
-
The `return` expression exits the corresponding dynamic function invocation or completes the corresponding dynamic async expression with the result of `exp`.
1893
+
The `return` expression exits the corresponding dynamic function invocation or completes the corresponding dynamic async expression with the result of `<exp>`.
1894
1894
1895
1895
// TBR async traps?
1896
1896
@@ -1953,7 +1953,7 @@ See <<type-Error>>.
1953
1953
[[exp-assert]]
1954
1954
=== Assert
1955
1955
1956
-
The assert expression `assert <exp>` has type `()` provided `exp` has type `Bool`.
1956
+
The assert expression `assert <exp>` has type `()` provided `<exp>` has type `Bool`.
1957
1957
1958
1958
Expression `assert <exp>` evaluates `<exp>` to a result `r`. If `r` is `trap` evaluation returns `trap`. Otherwise `r` is a Boolean value `v`. The result of `assert <exp>` is:
0 commit comments