Created
May 16, 2020 22:51
-
-
Save droyo/22df91ae34634c42e8c737fb27830c61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# let inc p = let v = !p in incr p; v;; | |
val inc : int ref -> int = <fun> | |
# let x = ref 0;; | |
val x : int ref = {contents = 0} | |
# type t_read = {tag: int; fid: int; offset: int; count: int};; | |
type t_read = { tag : int; fid : int; offset : int; count : int } | |
# let r = {tag=(inc x); fid=(inc x); offset=(inc x); count=(inc x)};; | |
val r : t_read = {tag = 3; fid = 2; offset = 1; count = 0} | |
# let x = ref 0;; | |
val x : int ref = {contents = 0} | |
# let r = {count=(inc x); offset=(inc x); fid=(inc x); tag=(inc x)};; | |
val r : t_read = {tag = 3; fid = 2; offset = 1; count = 0} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment