summaryrefslogtreecommitdiff
path: root/tnslc/simple.tnsl
diff options
context:
space:
mode:
Diffstat (limited to 'tnslc/simple.tnsl')
-rw-r--r--tnslc/simple.tnsl47
1 files changed, 20 insertions, 27 deletions
diff --git a/tnslc/simple.tnsl b/tnslc/simple.tnsl
index 90ee758..75b91bd 100644
--- a/tnslc/simple.tnsl
+++ b/tnslc/simple.tnsl
@@ -1,36 +1,29 @@
# No longer simple
-:include "c_wrap.tnsl"
+:include "c_wrap_linux.tnsl"
-enum LOL [int] {
- A = 1,
- B = 2,
- C = 4
-}
-
-struct Lolbert {
- int a, b, c,
+{}uint8 str = "Hello copy!\n\0"
- ~uint8 stuff
+struct Copier {
+ ~uint8 h8r
}
-/; lolbert1 (~Lolbert l, uint8 check) [bool]
- return l`.a == check
-;/
+/; method Copier
+ /; copy [Copier]
+ Copier out
+ out.h8r = self.h8r
+ return out
+ ;/
-/; main [int]
- Lolbert lol
- lol.a = 1
- lol.b = 4
- lol.c = 3
- lol.stuff = _alloc(2)
- lol.stuff{0} = 2
- lol.stuff{1} = 1
+;/
- /; if (lolbert1(~lol, lol.stuff{1}) && lolbert1(~lol, lol.stuff{0}))
- _delete(lol.stuff)
- return lol.a + lol.b
- ;/
- _delete(lol.stuff)
+/; main
+ Copier a
+ a.h8r = ~str{0}
+ ~Copier b
+ b = ~a
+ Copier c = b`.copy()
+ _printf(c.h8r)
return 0
-;/ \ No newline at end of file
+;/
+