From: Jim Pryor Date: Sun, 21 Nov 2010 22:14:09 +0000 (-0500) Subject: week9 tweak X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=586f5a66ee7fda507a0c28605c012805098c278c week9 tweak Signed-off-by: Jim Pryor --- diff --git a/week9.mdwn b/week9.mdwn index cdb4471f..43882882 100644 --- a/week9.mdwn +++ b/week9.mdwn @@ -600,7 +600,7 @@ Programming languages tend to provide a bunch of mutation-related capabilities a in !xcell;; (* evaluates to 1, not to 2 *) - So we have here the basis for introducing a new kind of equality predicate into our language, which tests not for qualitative indiscernibility but for numerical equality. In OCaml this relation is expressed by the double equals `==`. In Scheme it's spelled `eq?` Computer scientists sometimes call this relation "physical equality". Using this equality predicate, our comparison of ycell and xcell will be `false`, even if they then happen to contain the same `int`. + So we have here the basis for introducing a new kind of equality predicate into our language, which tests not for qualitative indiscernibility but for numerical equality. In OCaml this relation is expressed by the double equals `==`. In Scheme it's spelled `eq?` Computer scientists sometimes call this relation "physical equality". Using this equality predicate, our comparison of `ycell` and `xcell` will be `false`, even if they then happen to contain the same `int`. Isn't this interesting? Intuitively, elsewhere in math, you might think that qualitative indicernibility always suffices for numerical identity. Well, perhaps this needs discussion. In some sense the imaginary numbers ι and -ι are qualitatively identical, but numerically distinct. However, arguably they're not *fully* qualitatively identical. They don't both bear all the same relations to ι for instance. But then, if we include numerical identity as a relation, then `ycell` and `xcell` don't both bear all the same relations to `ycell`, either. Yet there is still a useful sense in which they can be understood to be qualitatively equal---at least, at a given stage in a computation. @@ -609,7 +609,7 @@ Programming languages tend to provide a bunch of mutation-related capabilities a Note that neither of the equality predicates here being considered are the same as the "hyperequals" predicate mentioned above. For example, in the following (fictional) language: let ycell = ref 1 - in let xcell = ref 2 + in let xcell = ref 1 in let wcell alias ycell in let zcell = ycell in ...