X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=week9.mdwn;h=9c886b0fcca40874f058c3b7de9e32e1386d702b;hp=f154d2ae9e7156d02814a3d9cb0ed503cbb34201;hb=1334a4b925de64f0913c507666b73e22235ba366;hpb=468f10def3d017479a35b92e5f6e3e3049048348 diff --git a/week9.mdwn b/week9.mdwn index f154d2ae..9c886b0f 100644 --- a/week9.mdwn +++ b/week9.mdwn @@ -100,6 +100,8 @@ Scheme is similar. There are various sorts of reference cells available in Schem (set-box! ycell 3) (+ x (unbox ycell))) +(C has explicit-style mutable variables, too, which it calls *pointers*. But simple variables in C are already mutable, in the implicit style.) + When dealing with explicit-style mutation, there's a difference between the types and values of `ycell` and `!ycell` (or `(unbox ycell)`). The former has the type `int ref`: the variable `ycell` is assigned a reference cell that contains an `int`. The latter has the type `int`, and has whatever value is now stored in the relevant reference cell. In an implicit-style framework though, we only have the resources to refer to the contents of the relevant reference cell. `y` in fragment [G] or the C snippet above has the type `int`, and only ever evaluates to `int` values. @@ -523,6 +525,9 @@ To get the whole process started, the complex computation so defined will need t Notice: h, p have same value (1), but f (h, p) and f (h, h) differ +Fine and Pryor on "coordinated contents" (see, e.g., [Hyper-Evaluativity](http://www.jimpryor.net/research/papers/Hyper-Evaluativity.txt)) + + ##Five grades of mutation involvement## -- FIXME -- @@ -586,7 +591,29 @@ To get the whole process started, the complex computation so defined will need t We use the `None`/`Some factorial` option type here just as a way to ensure that the contents of `fact_cell` are of the same type both at the start and the end of the block. +##Offsite Reading## + +* [[!wikipedia Declarative programming]] +* [[!wikipedia Functional programming]] +* [[!wikipedia Purely functional]] +* [[!wikipedia Side effect (computer science) desc="Side effects"]] +* [[!wikipedia Referential transparency (computer science)]] +* [[!wikipedia Imperative programming]] +* [[!wikipedia Reference (computer science) desc="References"]] +* [[!wikipedia Pointer (computing) desc="Pointers"]] +* [Pointers in OCaml](http://caml.inria.fr/resources/doc/guides/pointers.html) +