From: Jim Pryor Date: Sun, 21 Nov 2010 20:19:06 +0000 (-0500) Subject: week9 tweak X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=c73028930c6693a228c5a55a287f51d40bc72179;hp=1334a4b925de64f0913c507666b73e22235ba366 week9 tweak Signed-off-by: Jim Pryor --- diff --git a/week9.mdwn b/week9.mdwn index 9c886b0f..b38293d1 100644 --- a/week9.mdwn +++ b/week9.mdwn @@ -102,7 +102,7 @@ Scheme is similar. There are various sorts of reference cells available in Schem (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. +When dealing with explicit-style mutation, there's a difference between the types and values of `ycell` and `!ycell` (or in Scheme, `(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. ##Controlling order##