diff options
Diffstat (limited to 'lib/DATS/writer.dats')
-rw-r--r-- | lib/DATS/writer.dats | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/DATS/writer.dats b/lib/DATS/writer.dats index d5a327b..b7e9973 100644 --- a/lib/DATS/writer.dats +++ b/lib/DATS/writer.dats @@ -3,6 +3,9 @@ staload "lib/SATS/writer.sats" staload "lib/SATS/init.sats" +// when this .dats file not staloaded I get weird error from template function +staload "lib/DATS/init.dats" + #define ATS_DYNLOADFLAG 0 %{^ @@ -48,6 +51,7 @@ in implement _clear_screen(w) = let fun loop {n : nat | n < N - 1} .<N-n>. (i : int n, w : &writer_t) :<!wrt> void = (put_char('\0', w); if (i < N - 2) then loop(i+1,w)) + val () = w := @{position = 0, color_code = code_value(White,Black)} in loop(0,w); w.position := 0; @@ -103,17 +107,15 @@ in in end end + + implement clear_screen() : void = let val (vbox pf | p) = ref_get_viewptr(writer_ref) + implement init_exec$fwork<writer_t>(v) = _clear_screen(v) in - if p->initialized then - let - prval () = opt_unsome p->obj - val () = _clear_screen(p->obj) - prval () = opt_some p->obj - in - end + if p->initialized then + init_exec (!p) else let prval () = opt_unnone p->obj |