aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/hello.sloth17
1 files changed, 8 insertions, 9 deletions
diff --git a/examples/hello.sloth b/examples/hello.sloth
index 5deb0fc..4b99943 100644
--- a/examples/hello.sloth
+++ b/examples/hello.sloth
@@ -1,13 +1,12 @@
-# foreign fn example();
+foreign fn addz(lhs: Int, rhs: Int) Int;
-foreign fn foo() Int;
-foreign fn bar(y: Int, z: Int) Float;
+fn haiiii() Void {}
-fn main() Int {
- foo();
- foo();
- foo();
- bar(5, 8 * 3 + foo());
- return 7 + 5;
+fn hehehaha() Int {
+ var x: Int = 0;
+ while x < 10 {
+ x = x + 1;
+ }
+ return x;
}