diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-02-24 10:07:35 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-02-24 10:07:35 -0500 |
commit | 6f5a2bb7b7017bb574a32ff1c06449a1f9843214 (patch) | |
tree | 6bb960735a02a86f1bd53f62be9dd64c69856e96 /test.toc | |
parent | 055d5451bbad3ce530fa9f15b587ba8748fbf3de (diff) |
a bit of cleanup
Diffstat (limited to 'test.toc')
-rw-r--r-- | test.toc | 31 |
1 files changed, 5 insertions, 26 deletions
@@ -2,33 +2,12 @@ io ::= nms { #include "std/io.toc"; }; - - -Thing ::= struct(t::=int, u::t=3) { - it : t; - that : [u]t; -}; - -f ::= fn(t,u::=,th : &Thing(t,u)) { - x: t = 17 as t; - th.it = x; - for p, i := &th.that { - *p = i as t; - } -}; - -print_thing ::= fn(t, u::=, th: Thing(t, u)) { - io.puti(th.it as int); - for x := th.that { - io.puti(x as int); - } +f ::= fn(a,b::=3) int { + a + b }; main ::= fn() { - a: Thing(u = 5, t = u8); - f(&a); - print_thing(a); - b: Thing(); - f(&b); - print_thing(b); + x ::= f(); + io.puti(x); + io.puti(f()); };
\ No newline at end of file |