On 07/15/22 10:12, Richard W.M. Jones wrote:
On Fri, Jul 15, 2022 at 09:12:24AM +0200, Laszlo Ersek wrote:
+let do_action action = + try + match action with + | Unlink file -> Unix.unlink file + | Rm_rf dir -> + let cmd = sprintf "rm -rf %s" (Filename.quote dir) in ...
(2) Shouldn't we use two spaces for indentation here, relative to "R"?
Possibly, but this is what emacs tuareg-mode gives me.
I guess we need to get more serious about OCaml formatting at some point which may require fixing tuareg-mode too since it's quite erratic sometimes.
Right, I'm happy to adopt any particular guidelines; currently I'm sometimes just disoriented and looking for ideas how to format a particular construct I want to do. Especially because functions are first class citizens and can be passed around as arguments, formatting can become tricky. And "turn it into a named function" is not the right answer; it takes away quite a but of OCaml's power -- we *want* to be able to open-code function arguments to List.iter, List.map, List.filter, and so on! Laszlo