Small changes required for the upcoming "precompiled" version of learn-ocaml #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some quirks needed in porting to the pre-compiling version of learn-ocaml:
remove
#install_printer
(and any other) directives: we are no longer in a toplevel so these are no longer available. However, using tricky hacks, you can still define a printer for typefoo
with justlet print_<foo> ppf x = ... Format.fprintf ppf ...
replacing
open
intended for shadowing withinclude
in Prepare/Prelude(fpottier/unionfind/prepare.ml, mooc/week4/seq3/ex1/prepare.ml)
Open can't reach outside of its compilation unit
renamed multiple definitions of exceptions/types/modules with the same name
(fpottier/tictactoe/test.ml)
this is allowed in the toplevel but not by the OCaml compiler
renamed toplevel functions named
sample_*
that don't type as samplers(mooc/week3/seq4/ex1/test.ml, mooc/week5/seq1/ex1/test.ml)
These are dynamically typed later on, which just issues a warning, so we could
disable this less precise check altogether for better compat, but it seems
cleaner to reject them
avoid using a default sampler then overriding it
(mooc/week5/seq2/ex1/test.ml)
Due to difficulties in name resolution, this is forbidden, but the workaround
is simple: just alias the built-in sampler locally before the first use.