summaryrefslogtreecommitdiff
path: root/tnslc/proper_calling.tnsl
blob: 6fd5e69f21b5c13a4627bc7f2826e0c0e2ca1b56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
struct CallMe {
    int a, b
}

/; method CallMe
    /; call_two (int a, b) [int]
        return a + b + self.a + self.b
    ;/

    /; call_four (int a, b, c, d) [int]
        return self.call_two(a + b, b * c + d) + self.call_two(a * b + c, c + d)
    ;/

;/

/; main [int]
    CallMe cm
    cm.a = 0
    cm.b = 0
    return cm.call_four(0, 2, 2, 0)
;/