Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # let x = ref 42;;
- val x : int ref = {contents = 42}
- # x := 100/4;;
- - : unit = ()
- # let y = !x + 1;;
- val y : int = 26
- # print_int 3;;
- - : unit = <unknown constructor>
- # print_string "Hello";;
- - : unit = <unknown constructor>
- # print_string "x = ";
- # print_int !x;
- # print_newline ();;
- - : unit = ()
- # Printf.printf "x = %d. Bye %s\n" !x "John";;
- - : unit = ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement