aboutsummaryrefslogtreecommitdiff
path: root/examples/hello.sloth
blob: f4e6692ee8858fe0d6c20001b585fe0c7cc0d053 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}