Advertisement
Guest User

Untitled

a guest
Aug 5th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. # The problem with ocaml 4.01.0 and 4.02.1
  2.  
  3. freehck@ws-kashin:~/prog/ocaml-error% cat catcher.ml
  4. let raiser () =
  5. raise Not_found
  6.  
  7. let catcher () =
  8. try
  9. raiser ()
  10. with exn ->
  11. print_endline ("Exception: " ^ (Printexc.to_string exn));
  12. raise exn
  13.  
  14. let _ = catcher ()
  15. freehck@ws-kashin:~/prog/ocaml-error% ocamlc -g catcher.ml -o catcher-ocamlc
  16. freehck@ws-kashin:~/prog/ocaml-error% ocamlopt -g catcher.ml -o catcher-ocamlopt
  17. freehck@ws-kashin:~/prog/ocaml-error% ./catcher-ocamlc
  18. Exception: Not_found
  19. Fatal error: exception Not_found
  20. Raised at file "catcher.ml", line 2, characters 8-17
  21. Called from file "catcher.ml", line 6, characters 4-13
  22. Re-raised at file "catcher.ml", line 9, characters 10-13
  23. Called from file "catcher.ml", line 11, characters 8-18
  24. freehck@ws-kashin:~/prog/ocaml-error% ./catcher-ocamlopt
  25. Exception: Not_found
  26. Fatal error: exception Not_found
  27. Raised by primitive operation at file "catcher.ml", line 6, characters 4-13
  28. Re-raised at file "catcher.ml", line 9, characters 10-13
  29. Called from file "catcher.ml", line 11, characters 8-18
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement