diff options
| author | Cody <cody@codyq.dev> | 2023-06-26 07:20:34 -0500 |
|---|---|---|
| committer | Cody <cody@codyq.dev> | 2023-06-26 07:20:34 -0500 |
| commit | 849ba9ffa6ba9ac00bbc5fdb144a48cf7076a46f (patch) | |
| tree | 071eaa4dbf30f590faecc4834f4d4a209413ddd2 /examples | |
| parent | 03021268fc319aa5e19e7bbcac226f3f626a6f84 (diff) | |
| download | sloth-849ba9ffa6ba9ac00bbc5fdb144a48cf7076a46f.tar.gz | |
Working dynamically sized arrays (syntax not right)
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/hello.sloth | 15 |
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; } |
