From 6f5a2bb7b7017bb574a32ff1c06449a1f9843214 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Mon, 24 Feb 2020 10:07:35 -0500 Subject: a bit of cleanup --- test.toc | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'test.toc') diff --git a/test.toc b/test.toc index c9ef4b3..5eef11f 100644 --- a/test.toc +++ b/test.toc @@ -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 -- cgit v1.2.3