From 849ba9ffa6ba9ac00bbc5fdb144a48cf7076a46f Mon Sep 17 00:00:00 2001 From: Cody Date: Mon, 26 Jun 2023 07:20:34 -0500 Subject: Working dynamically sized arrays (syntax not right) --- examples/hello.sloth | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'examples/hello.sloth') 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; } -- cgit v1.2.3