Introduction to Reason Compilation
[CG]Nick
13.8K views
Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
3 - Compile Many Files, Automatically, in the Right Order
We can't manually sort the source files each time there's a dependency change. Let's automate it! Read run.sh
.
"Run"
1
2
3
4
5
6
7
/* Note that `myDep.re` becomes the module `MyDep`. In OCaml and Reason syntax, a module is upper-cased. */
/* We now have 2 dependencies, where MyDep2 also depends on myDep. So the compilation order should be [myDep,
myDep2, test] */
print_endline MyDep.secret;
print_endline MyDep2.secret;
Enter to Rename, Shift+Enter to Preview
1
let secret = "hello";
Enter to Rename, Shift+Enter to Preview
1
let secret = MyDep.secret ^ " world";
Enter to Rename, Shift+Enter to Preview
1
cd step3
Enter to Rename, Shift+Enter to Preview
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content