Skip to content

Commit 81f2d3e

Browse files
committed
examples: Fix silly syntax errors
1 parent 8d9bdbc commit 81f2d3e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

examples/factorial.pics

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import std.io
33

44
factorial :: (x=1) =
5-
if x <= 1 { 1 }
6-
else { x * factorial(x - 1) }
5+
if x <= 1 do { 1 }
6+
else do { x * factorial(x - 1) }
77

88
result := factorial(5)
99
IO::println(result)

examples/modules.pics

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Foo::baz()
1414

1515
Foo :: module {
1616
Foo2 :: module {
17-
function bar2() = IO::println("Foo::Foo2::bar2")
17+
bar2 :: () = IO::println("Foo::Foo2::bar2")
1818
}
1919
}
2020

examples/showcase.pics

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ first := numbers[0]
2121

2222

2323
// If-Else
24-
if 1 > 1 { numbers } else { joined }
24+
if 1 > 1 do { numbers } else do { joined }
2525

2626
// When
2727
when numbers {

examples/virtual3.pics

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ getProfile :: (id = 0) = Virtual::task(|_| -> do {
1515
profile
1616
})
1717

18-
printProfile :: (kind, user) = IO::println(String::format("%s := {name: %s}", [kind, user.name]))
18+
printProfile :: (kind, user) = IO::println(String::format("%s := {{name: %s}}", [kind, user.name]))
1919

2020

2121
IO::println("Start")

0 commit comments

Comments
 (0)