ocamlocamlbuildocamlfind

Is there a way to tell ocamlbuild to run my file instead of just produce an executable?


Right now, if I want to recompile and run an ml file I use

ocamlbuild -pkg containers myfile.byte && ./myfile.byte

Is there a shorter way to do this? In haskell you can run things just by saying runghc myfile.hs and I wonder if ocamlbuild or ocamlfind offer something similar.


Solution

  • Yes. All arguments after -- are passed on to the program to run. So if there are none for your program, do ocamlbuild -pkg containers myfile.byte -- saving you 14 keystrokes :).