summaryrefslogtreecommitdiff
path: root/ocaml/lib/nock.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ocaml/lib/nock.ml')
-rw-r--r--ocaml/lib/nock.ml16
1 files changed, 8 insertions, 8 deletions
diff --git a/ocaml/lib/nock.ml b/ocaml/lib/nock.ml
index ac6a2ad..2d106b6 100644
--- a/ocaml/lib/nock.ml
+++ b/ocaml/lib/nock.ml
@@ -73,8 +73,8 @@ let rec nock_on bus fol =
(* Log entry - shows opcode, depth, subject type, and mug at shallow depths *)
if should_log then begin
let opcode_str = match fol with
- | Cell (Atom op, _) when Z.fits_int op -> opcode_name (Z.to_int op)
- | Cell (Cell _, _) -> "CELL(dist)"
+ | Cell { h = Atom { z = op; _ }; _ } when Z.fits_int op -> opcode_name (Z.to_int op)
+ | Cell { h = Cell _; _ } -> "CELL(dist)"
| _ -> "?"
in
(* Only compute mugs at shallow depths to avoid performance penalty *)
@@ -97,13 +97,13 @@ let rec nock_on bus fol =
try
let result = match fol with
- | Cell (hib, gal) when is_cell hib ->
+ | Cell { h = hib; t = gal; _ } when is_cell hib ->
(* Distribution: [a b] -> compute both sides and cons *)
let poz = nock_on bus hib in
let riv = nock_on bus gal in
cell poz riv
- | Cell (Atom op, gal) ->
+ | Cell { h = Atom { z = op; _ }; t = gal; _ } ->
(* Check if opcode fits in int *)
if Z.compare op (Z.of_int max_int) > 0 then raise Exit;
let opcode = Z.to_int op in
@@ -112,7 +112,7 @@ let rec nock_on bus fol =
| 0 ->
(* Nock 0: /[axis subject] - slot/fragment lookup *)
if not (is_atom gal) then raise Exit
- else slot (match gal with Atom n -> n | _ -> raise Exit) bus
+ else slot (match gal with Atom { z = n; _ } -> n | _ -> raise Exit) bus
| 1 ->
(* Nock 1: constant - return gal as-is *)
@@ -156,8 +156,8 @@ let rec nock_on bus fol =
let d_gal = tail cd_gal in
let tys = nock_on bus b_gal in
let nex = match tys with
- | Atom n when Z.equal n Z.zero -> c_gal
- | Atom n when Z.equal n Z.one -> d_gal
+ | Atom { z = n; _ } when Z.equal n Z.zero -> c_gal
+ | Atom { z = n; _ } when Z.equal n Z.one -> d_gal
| _ -> raise Exit
in
nock_on bus nex
@@ -186,7 +186,7 @@ let rec nock_on bus fol =
let c_gal = tail gal in
if not (is_atom b_gal) then raise Exit;
let seb = nock_on bus c_gal in
- let nex = slot (match b_gal with Atom n -> n | _ -> raise Exit) seb in
+ let nex = slot (match b_gal with Atom { z; _ } -> z | _ -> raise Exit) seb in
nock_on seb nex
| 10 ->