From: Jim Pryor Date: Sun, 21 Nov 2010 19:32:18 +0000 (-0500) Subject: week9 tweak X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=468f10def3d017479a35b92e5f6e3e3049048348 week9 tweak Signed-off-by: Jim Pryor --- diff --git a/week9.mdwn b/week9.mdwn index 145833d5..f154d2ae 100644 --- a/week9.mdwn +++ b/week9.mdwn @@ -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