From 468f10def3d017479a35b92e5f6e3e3049048348 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Sun, 21 Nov 2010 14:32:18 -0500 Subject: [PATCH] week9 tweak Signed-off-by: Jim Pryor --- week9.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.11.0