- You might expect that there'd be an equality predicate that counts the first pair as equal, but not the second. But there isn't. OCaml's physical identity predicate `==` counts each pair as non-equal, even though the first of them involves the same structure containing only physically identical components. OCaml's structural equality preficate `=` counts both pairs as equal; it's insensitive to the lack of physical identity between `ycell` and `ref !ycell`.
+ You might expect the first pair to be numerically identical too---after all, they involve the same structure (an immutable triple) each of whose components is numerically identical. But OCaml's "physical identity" predicate `==` does not detect that identity. It counts both of these comparisons as false. OCaml's `=` predicate does count the first pair as equal, but only because it's insensitive to numerical identity; it also counts the second pair as equal. This shows up in all the other languages I know, as well. In Python, `y = []; (0, 1, y) is (0, 1, y)` evaluates to false. In Racket, `(define y (box 1)) (eq? (cons 0 y) (cons 0 y))` also evaluates to false (and in Racket, unlike traditional Schemes, `cons` is creating immutable pairs). They chose an implementation for their numerical identity predicates that is especially efficient and does the right thing in the common cases, but doesn't quite match our mathematical expectations.