package ppx_defer
Build not checkedInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b87ca804d9cb97bb2a7832dc891b5d3617ea7f5e16cee4c158e63b77e4babae3
md5=010ce32e79ef4ff23025fc2aac4ce721
Description
([%defer e1]; e2) will defer the evaluation of e1 until after e2 is
evaluated.
README
ppx_defer
This is an OCaml language extension implementing a somewhat Go-ish [%defer expr1]; expr2 which will defer the evaluation of expr1 until after expr2. expr1 will still be evaluated if expr2 raises an exception.
The implementation is based purely on moving syntax around so ppx_defer is not as powerful or safe as Go's defer.
Thanks to Drup for guidance in figuring out ppx details!
Using ppx_defer
let () =
let ic = open_in_bin "some_file" in
[%defer close_in ic];
let length = in_channel_length ic in
let bytes = really_input_string ic length in
print_endline bytes
Dependencies (4)
-
ocamlbuild
build -
ocamlfind
build -
ppx_tools
>= "0.99.3" -
ocaml
>= "4.02.3"
Dev Dependencies
None
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building ppx_defer with each compiler on check.ci.ocaml.org, run of against opam-repository 6e2873f. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
This version is not in the latest run; the versions below are.
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure