summaryrefslogtreecommitdiff
path: root/tnslc/simple.tnsl
blob: 75b91bdce0470fa102dc2ec8aa3faeb690339f6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# No longer simple
:include "c_wrap_linux.tnsl"

{}uint8 str = "Hello copy!\n\0"

struct Copier {
    ~uint8 h8r
}

/; method Copier

    /; copy [Copier]
        Copier out
	out.h8r = self.h8r
	return out
    ;/

;/

/; main
    Copier a
    a.h8r = ~str{0}
    ~Copier b
    b = ~a
    Copier c = b`.copy()
    _printf(c.h8r)
    return 0
;/