Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Notice that the two invocations of `f 1` yield different results, even though the same value is being supplied as an argument to the same function.
Notice that the two invocations of `f 1` yield different results, even though the same value is being supplied as an argument to the same function.
+Similarly, functions like these:
+
+ let f cell = !cell;;
+
+ let g cell = cell := !cell + 1; !cell;;
+
+may return different results each time they're invoked, even if they're always supplied one and the same reference cell as argument.
+
Computer scientists also associate referential transparency with a kind of substitution principle, illustrated here:
let x = 1
Computer scientists also associate referential transparency with a kind of substitution principle, illustrated here:
let x = 1