CCSDS 508.1-B Re-entry Data Message parser and serializer
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-rdm: bind report function and add fmt to mdx libs

The README example referenced [kvn_text] as a free variable, used a
stray paren before the inner match, and mixed [Printf.printf] with
[Fmt.epr]. Wrap as [report kvn_text = ...], use [Fmt.pr] throughout,
and add [fmt] to the mdx libraries.

+10 -11
+9 -10
README.md
··· 31 31 ## Usage 32 32 33 33 ```ocaml 34 - match Rdm.of_string kvn_text with 35 - | Ok rdm -> 36 - Printf.printf "Object: %s\n" rdm.metadata.object_name; 37 - Printf.printf "Reentry epoch: %s\n" rdm.reentry.reentry_epoch; 38 - ( 39 - match rdm.reentry.impact_latitude, rdm.reentry.impact_longitude with 40 - | Some lat, Some lon -> 41 - Printf.printf "Impact: %.3f N, %.3f E\n" lat lon 42 - | _ -> print_endline "Impact location unknown") 43 - | Error e -> Fmt.epr "%a\n" Rdm.pp_error e 34 + let report kvn_text = 35 + match Rdm.of_string kvn_text with 36 + | Error e -> Fmt.epr "%a@." Rdm.pp_error e 37 + | Ok rdm -> ( 38 + Fmt.pr "Object: %s@." rdm.metadata.object_name; 39 + Fmt.pr "Reentry epoch: %s@." rdm.reentry.reentry_epoch; 40 + match (rdm.reentry.impact_latitude, rdm.reentry.impact_longitude) with 41 + | Some lat, Some lon -> Fmt.pr "Impact: %.3f N, %.3f E@." lat lon 42 + | _ -> Fmt.pr "Impact location unknown@.") 44 43 ``` 45 44 46 45 ## API Overview
+1 -1
dune
··· 4 4 5 5 (mdx 6 6 (files README.md) 7 - (libraries rdm)) 7 + (libraries rdm fmt))