diff options
Diffstat (limited to 'lib/DATS/writer.dats')
-rw-r--r-- | lib/DATS/writer.dats | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/DATS/writer.dats b/lib/DATS/writer.dats index 92314b7..d5a327b 100644 --- a/lib/DATS/writer.dats +++ b/lib/DATS/writer.dats @@ -84,9 +84,10 @@ in // Static variable var _writer : writer_t? prval () = opt_none _writer - var writer = empty<writer_t>(_writer) + var writer = uninitialized<writer_t>(_writer) in - val writer_ref = ref_make_viewptr{enablable writer_t} (view@writer | addr@writer) + // Reference to writer + val writer_ref = ref_make_viewptr{initializable writer_t} (view@writer | addr@writer) end in @@ -95,7 +96,7 @@ in val (vbox pf | p) = ref_get_viewptr(writer_ref) implement string_foreach$fwork<writer_t> (c,env) = put_char(c,env) in - if p->enabled then let + if p->initialized then let prval () = opt_unsome p->obj val _ = $effmask_ref(string_foreach_env<writer_t> (g1ofg0(str),p->obj)) prval () = opt_some p->obj @@ -106,7 +107,7 @@ in implement clear_screen() : void = let val (vbox pf | p) = ref_get_viewptr(writer_ref) in - if p->enabled then + if p->initialized then let prval () = opt_unsome p->obj val () = _clear_screen(p->obj) @@ -117,7 +118,7 @@ in let prval () = opt_unnone p->obj val () = p->obj := @{position = 0, color_code = code_value(White,Black)} - val () = p->enabled := true + val () = p->initialized := true val () = _clear_screen(p->obj) prval () = opt_some p->obj in |