Skip to content

Commit 7e11981

Browse files
committed
change let to val
1 parent c45c984 commit 7e11981

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

content/design.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ Some examples of specifiers are:
8585
which is `x U64, y U65`. Data type specifiers contain no body.
8686
- value specifier:
8787
```
88-
let value: U8 := 5
88+
val value: U8 := 5
8989
```
90-
where `let value` is a *value declaration*, separated with colon from the type information, which is `U8`. Next,
90+
where `val value` is a *value declaration*, separated with colon from the type information, which is `U8`. Next,
9191
the body contains the value assigned to the named value instance. Value specifications may have data type omitted in
92-
situations when it can be inferred; for instance, we can also write the specifier above as `let value := 5#U8`, where
92+
situations when it can be inferred; for instance, we can also write the specifier above as `val value := 5#U8`, where
9393
`#U8` is a type annotation.
9494

9595
<div></div>
@@ -165,7 +165,7 @@ following manner:
165165
```
166166
fx twoArgsFn: x U32, y U32 -> U32
167167
168-
let coord := x U32, y U32
168+
val coord := x U32, y U32
169169
twoArgsFn coord
170170
```
171171

@@ -196,7 +196,7 @@ with `|:`:
196196
```
197197
data WorldDirection: north | south | west | east
198198
199-
let sample: WorldDirection
199+
val sample: WorldDirection
200200
201201
sample >| – match sample {
202202
north |? doSomething1 – north => {}
@@ -501,7 +501,7 @@ type may be omitted, and in this case if is inferred by the compiler from the bo
501501

502502
Finally, there is the multiline forms of lambda expressions:
503503
```
504-
let lambdaFn := .\
504+
lambda lambdaFn
505505
statement1
506506
statement2
507507
```
@@ -523,7 +523,7 @@ someFn arg1, .\(x U8 -> U16
523523

524524
The type of the lambda expression is `.\ input -> output`, and this type may be used in type annotations:
525525
```
526-
let squared: .\U8 -> U16 := .\pow 2
526+
val squared: .\U8 -> U16 := .\pow 2
527527
```
528528

529529
<!-- TODO: add on currying:

content/examples.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ data Result: T any, E error => ok(T) | err(E)
5858

5959
```
6060
infx `+`: a Coord2D, b Coord2D -> Coord2D
61-
let x := a.x + b.x
62-
let y := a.y + b.y
61+
val x := a.x + b.x
62+
val y := a.y + b.y
6363
x, y
6464
```
6565

@@ -68,7 +68,7 @@ infx `+`: a Coord2D, b Coord2D -> Coord2D
6868
```
6969
data WorldDirection: north | south | west | east
7070
71-
let sample: WorldDirection = random
71+
val sample: WorldDirection = random
7272
7373
sample >|
7474
north |? println("I am northman")
@@ -101,7 +101,7 @@ infx findFirst: V eq, I iter(item eq) => iter I, value V -> U64?
101101
enumerate iter |> fst =? value |? $ := lst _
102102
103103
infx hasUnique: V eq, I iter(item eq) => iter I, value V -> Bool
104-
let index := iter findFirst value !! false
104+
val index := iter findFirst value !! false
105105
(iter[index..] |> =? value |? $ := false) ?? true
106106
107107
[0, 1, 2, 3, 4] hasUnique 1 -- true
@@ -110,7 +110,7 @@ infx hasUnique: V eq, I iter(item eq) => iter I, value V -> Bool
110110
### Collection comprehensions
111111

112112
```
113-
let congratulations :=
113+
val congratulations :=
114114
[ "Happy birthday, \(_)" <| birthdays.values.flatten ]
115115
```
116116

@@ -120,8 +120,8 @@ let congratulations :=
120120
fx sumOrZero: x U32, y U32 -> U32
121121
x +? y ?? 0 -- here we return zero on overflow
122122
123-
let x, y: U32, U32 := random, random
124-
let sum = x +? y !! overflow -- here we return Err(overflow) on overflow
123+
val x, y: U32, U32 := random, random
124+
val sum = x +? y !! overflow -- here we return Err(overflow) on overflow
125125
sumOrZero sum, x
126126
```
127127

content/reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,14 +489,14 @@ iterations, like with `$-1`, accessing the previous iteration result, or
489489
definition and body:
490490

491491
```
492-
let local: U8 = random
492+
val local: U8 = random
493493
lambda sq: x U8 -> U32
494494
pow 2 + local
495495
```
496496

497497
As any other specifier it can be put into a single line:
498498
```
499-
let local: U8 = random
499+
val local: U8 = random
500500
lambda sq: x U8 -> U32 := pow 2 + local
501501
```
502502

0 commit comments

Comments
 (0)