mte/unikernel/duniverse/dune_/test/blackbox-tests/test-cases/mdx-stanza/preludes.t
2025-11-11 02:07:51 +01:00
..
a.ml 2025-11-11 02:07:51 +01:00
b.ml 2025-11-11 02:07:51 +01:00
default.ml 2025-11-11 02:07:51 +01:00
dune 2025-11-11 02:07:51 +01:00
dune-project 2025-11-11 02:07:51 +01:00
README.md 2025-11-11 02:07:51 +01:00
run.t 2025-11-11 02:07:51 +01:00

Using the mdx stanza, you can set mdx prelude which are used to evaluate code in the toplevel environments before checking a document. To do that you can set the prelude field of the stanza: (preludes <prelude_file> ...).

# x;;
- : int = 1

Different environment can have their own prelude. This is set using the (env <env_name> <prelude_file>) syntax for the prelude field. Here x and why are set in alt.ml.

# x + y;;
- : int = 11
# x + y;;
- : int = 21