core_bench icon indicating copy to clipboard operation
core_bench copied to clipboard

Example in the doc doesn't work

Open sorawee opened this issue 1 year ago • 0 comments

The example in the documentation results in the following error:

File "test.ml", line 8, characters 2-13:
8 |   Command.run (Bench.make_command [
      ^^^^^^^^^^^
Error (alert deprecated): Core.Command.run
[since 2021-03] Use [Command_unix]
File "test.ml", line 8, characters 2-13:
8 |   Command.run (Bench.make_command [
      ^^^^^^^^^^^
Error: This expression has type [ `Use_Command_unix ]
       This is not a function; it cannot be applied.

This can be fixed by switching to Command_unix.run and adding core_unix.command_unix to the libraries clause in the Dune config (which should ideally be noted in the doc). However, this doesn't seem like the right thing to do either, as the name Command_unix implies that the program wouldn't work cross-platform.

sorawee avatar Mar 18 '23 19:03 sorawee