aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-06-26 07:20:34 -0500
committerCody <cody@codyq.dev>2023-06-26 07:20:34 -0500
commit849ba9ffa6ba9ac00bbc5fdb144a48cf7076a46f (patch)
tree071eaa4dbf30f590faecc4834f4d4a209413ddd2 /examples
parent03021268fc319aa5e19e7bbcac226f3f626a6f84 (diff)
downloadsloth-849ba9ffa6ba9ac00bbc5fdb144a48cf7076a46f.tar.gz
Working dynamically sized arrays (syntax not right)
Diffstat (limited to 'examples')
-rw-r--r--examples/hello.sloth15
1 files changed, 7 insertions, 8 deletions
diff --git a/examples/hello.sloth b/examples/hello.sloth
index 4b99943..7378cb1 100644
--- a/examples/hello.sloth
+++ b/examples/hello.sloth
@@ -1,12 +1,11 @@
-foreign fn addz(lhs: Int, rhs: Int) Int;
+fn test() [Int 3] {
+ var list: [Int 3] = [9, 5, 7];
-fn haiiii() Void {}
+ vpushi(list, 3);
+ vpushi(list, 3);
+ vpushi(list, 3);
+ vpushi(list, 5);
-fn hehehaha() Int {
- var x: Int = 0;
- while x < 10 {
- x = x + 1;
- }
- return x;
+ return list;
}