summaryrefslogtreecommitdiff
path: root/ocaml/lib/serial.ml
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-06 23:06:50 +0700
committerpolwex <polwex@sortug.com>2025-10-06 23:06:50 +0700
commitfdab65f6dac4ba85ed4749f61970660d1132d453 (patch)
tree427123729c6d556f040bed6a0e461f6d0887c9bf /ocaml/lib/serial.ml
parentbf4c5ff0fd28d94b7f22552a79e6fbe2561fe6cf (diff)
added mutable mugs
Diffstat (limited to 'ocaml/lib/serial.ml')
-rw-r--r--ocaml/lib/serial.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/ocaml/lib/serial.ml b/ocaml/lib/serial.ml
index ac97421..457385e 100644
--- a/ocaml/lib/serial.ml
+++ b/ocaml/lib/serial.ml
@@ -92,7 +92,7 @@ let jam noun =
let rec jam_noun n =
match n with
- | Atom a ->
+ | Atom { z = a; _ } ->
(* Check if we've seen this atom before *)
begin match Hashtbl.find_opt positions n with
| Some pos ->
@@ -117,7 +117,7 @@ let jam noun =
mat_encode w a
end
- | Cell (head, tail) ->
+ | Cell { h = head; t = tail; _ } ->
(* Check for backref *)
begin match Hashtbl.find_opt positions n with
| Some pos ->
@@ -246,7 +246,7 @@ let cue ?progress ?(progress_interval = 200_000) ?inspect bytes =
let cell_pos = pos_arr.(idx) in
head_arr.(idx) <- None;
stack_size := idx;
- let cell = Cell (head, noun) in
+ let cell = Cell { h = head; t = noun; mug = 0l } in
IntTable.replace backref_table cell_pos cell;
emit cell
end
@@ -262,7 +262,7 @@ let cue ?progress ?(progress_interval = 200_000) ?inspect bytes =
inspect_event (Cue_atom_begin { position = pos; value_bits = bits })
in
let (value, total_bits, value_bits) = mat_decode ~on_value_bits r in
- let atom = Atom value in
+ let atom = Atom { z = value; mug = 0l } in
IntTable.replace backref_table pos atom;
inspect_event (Cue_atom_end { position = pos; total_bits; value_bits });
emit atom