week9: another Seasoned Schemer ref
authorJim Pryor <profjim@jimpryor.net>
Tue, 21 Dec 2010 04:33:47 +0000 (23:33 -0500)
committerJim Pryor <profjim@jimpryor.net>
Tue, 21 Dec 2010 04:33:47 +0000 (23:33 -0500)
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
week9.mdwn

index a9f168b..f854d27 100644 (file)
@@ -228,6 +228,8 @@ If however you called `factory` twice, you'd have different `getter`/`setter` pa
 
 Here, the call to `setter` only mutated the reference cell associated with the `getter`/`setter` pair. The reference cell associated with `getter'` hasn't changed, and so `getter' ()` will still evaluate to 1.
 
 
 Here, the call to `setter` only mutated the reference cell associated with the `getter`/`setter` pair. The reference cell associated with `getter'` hasn't changed, and so `getter' ()` will still evaluate to 1.
 
+If you've got a copy of *The Seasoned Schemer*, which we recommended for the seminar, see the discussion at pp. 91-117 and 127-137.
+
 Notice in these fragments that once we return from inside the call to `factory`, the `free_var` mutable variable is no longer accessible, except through the helper functions `getter` and `setter` that we've provided. This is another way in which a thunk like `getter` can be useful: it still has access to the `free_var` reference cell that was created when it was, because its free variables are interpreted relative to the context in which `getter` was built, even if that context is otherwise no longer accessible. What `getter ()` evaluates to, however, will very much depend on *when* we evaluate it---in particular, it will depend on which calls to the corresponding `setter` were evaluated first.
 
 ##Referential opacity##
 Notice in these fragments that once we return from inside the call to `factory`, the `free_var` mutable variable is no longer accessible, except through the helper functions `getter` and `setter` that we've provided. This is another way in which a thunk like `getter` can be useful: it still has access to the `free_var` reference cell that was created when it was, because its free variables are interpreted relative to the context in which `getter` was built, even if that context is otherwise no longer accessible. What `getter ()` evaluates to, however, will very much depend on *when* we evaluate it---in particular, it will depend on which calls to the corresponding `setter` were evaluated first.
 
 ##Referential opacity##