From 00e423d30edf38a5e57c5c1c52cdb323c62850bc Mon Sep 17 00:00:00 2001 From: Cody Date: Mon, 26 Jun 2023 17:12:55 -0500 Subject: vpop & function args --- examples/hello.sloth | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'examples') 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; +} + -- cgit v1.2.3