I’ve written a very small snippet in ocaml, and what it does is return the linux function “lsbk” which does not exist on the freebsd o.s. It calls some system functions and put the results in an associative-array list.
Feel free to comment on the style used.
- I would recommend to switch to dune build system
- It doesn’t encourage you to commit object files
- In combination with VsCode add-on it will to autoformatting easily
- It will allow you to test my linter experiment GitHub - Kakadu/mylinter
- Concatenation of string using
^
may be inefficient - You are reinventing some functions from Stdlib
- Functional style usually avoids mutable references. Please, rewrite without them
- Identifiers with many underscores like
___
look weird. Do you really need a value called that in the scope?
1 Like