Advertisement
Guest User

Untitled

a guest
May 15th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. test.c
  2. ========
  3. #include <caml/mlvalues.h>
  4.  
  5. value test_add2 (value i) {
  6. return Val_int (Int_val (i) + 2);
  7. }
  8.  
  9. test.mli
  10. ========
  11. external add2 : int -> int = "test_add2";;
  12.  
  13. main.ml
  14. ========
  15. let main () =
  16. let i = 13 in
  17. Printf.printf "%d -> %d" i (Test.add2 i);
  18. print_newline ()
  19. ;;
  20.  
  21. let () = main ();;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement