diff options
author | polwex <polwex@sortug.com> | 2025-10-07 02:22:58 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-10-07 02:22:58 +0700 |
commit | 23a57eed38d560f0c2d84cc7803fafc74dbcc1dd (patch) | |
tree | 83a5bb11a7e6ad7714581e9b0ed358676d2a054c /ocaml/test_cue_solid.ml | |
parent | a12407b3f152a3dbd716d640202b9613c61d6105 (diff) |
working on solid pill in ocaml
Diffstat (limited to 'ocaml/test_cue_solid.ml')
-rw-r--r-- | ocaml/test_cue_solid.ml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ocaml/test_cue_solid.ml b/ocaml/test_cue_solid.ml new file mode 100644 index 0000000..95be2da --- /dev/null +++ b/ocaml/test_cue_solid.ml @@ -0,0 +1,17 @@ +open Nock_lib + +let () = + let bytes = Eio.Path.(load (Eio.Stdenv.fs (Eio_main.run (fun env -> env)) / "solid.pill")) |> Bytes.of_string in + Printf.printf "File size: %d bytes\n" (Bytes.length bytes); + + let noun = Serial.cue bytes in + Printf.printf "Cued successfully\n"; + Printf.printf "Is atom: %b\n" (Noun.is_atom noun); + Printf.printf "Is cell: %b\n" (Noun.is_cell noun); + + if Noun.is_cell noun then begin + let h = Noun.head noun in + let t = Noun.tail noun in + Printf.printf "Head is atom: %b\n" (Noun.is_atom h); + Printf.printf "Tail is atom: %b\n" (Noun.is_atom t) + end |