week9 tweak
authorJim Pryor <profjim@jimpryor.net>
Sun, 21 Nov 2010 19:32:18 +0000 (14:32 -0500)
committerJim Pryor <profjim@jimpryor.net>
Sun, 21 Nov 2010 19:32:18 +0000 (14:32 -0500)
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
week9.mdwn

index 145833d..f154d2a 100644 (file)
@@ -236,6 +236,14 @@ The core idea to referential transparency is that when the same value is supplie
 
 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