From c6ad352a25b6b1d45e56090ccc0432d123b043bc Mon Sep 17 00:00:00 2001 From: Xander Date: Fri, 28 Jul 2023 16:02:02 +0200 Subject: Work on writer --- lib/DATS/writer.dats | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'lib/DATS') diff --git a/lib/DATS/writer.dats b/lib/DATS/writer.dats index b7e9973..9b2fd78 100644 --- a/lib/DATS/writer.dats +++ b/lib/DATS/writer.dats @@ -98,24 +98,21 @@ in implement put_string (str : string) : void = let val (vbox pf | p) = ref_get_viewptr(writer_ref) - implement string_foreach$fwork (c,env) = put_char(c,env) + implement init_exec$fwork(v) = let + implement string_foreach$fwork (c,env) = put_char(c,env) + val _ = $effmask_all(string_foreach_env (g1ofg0(str),v)) + in + end in - if p->initialized then let - prval () = opt_unsome p->obj - val _ = $effmask_ref(string_foreach_env (g1ofg0(str),p->obj)) - prval () = opt_some p->obj - in - end + init_exec(!p) end - - implement clear_screen() : void = let val (vbox pf | p) = ref_get_viewptr(writer_ref) implement init_exec$fwork(v) = _clear_screen(v) in if p->initialized then - init_exec (!p) + init_exec (!p) else let prval () = opt_unnone p->obj -- cgit v1.2.3