Skip to content

Commit 1c679a1

Browse files
committed
README: Fix the readme to reflect the latest syntax change
1 parent 15b9232 commit 1c679a1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,23 @@ $ ./all.sh
5757
```js
5858
import std.io
5959

60-
function main() = IO.println("Hello, world")
61-
62-
main()
60+
main :: () = IO::println("Hello, world")
6361
```
6462

6563
###### Factorial
6664

6765
```js
6866
import std.io
6967

70-
function fact(x=1) =
68+
fact :: (x=1) =
7169
when x {
7270
is 0 -> 1
7371
is 1 -> 1
7472
else -> x * fact(x - 1)
7573
}
74+
75+
result := fact(5)
76+
IO::println(result)
7677
```
7778

7879
## Embedding API

0 commit comments

Comments
 (0)