aboutsummaryrefslogtreecommitdiff
path: root/examples/hello.sloth
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello.sloth')
-rw-r--r--examples/hello.sloth15
1 files changed, 13 insertions, 2 deletions
diff --git a/examples/hello.sloth b/examples/hello.sloth
index 1bbdbd4..f4e6692 100644
--- a/examples/hello.sloth
+++ b/examples/hello.sloth
@@ -1,11 +1,22 @@
-fn test() [Int 3] {
- var list: [Int 3] = [500, 5, 7];
+fn test() [Int] {
+ var list: [Int] = [500, 5, 7];
vpushi(list, 3);
vpushi(list, 3);
vpushi(list, 3);
vpushi(list, 5);
+ var x: Int = vpopi(list);
+ vpushi(list, x);
+ vpushi(list, x * 2);
+ vpushi(list, x * 3);
+
return list;
}
+fn testtwo(list: [Int]) Int {
+ #vpopi(list);
+ var x: Int = vpopi(list);
+ return x;
+}
+