Signed-off-by: Jim Pryor <profjim@jimpryor.net>
##Adding Aliasing and Passing by Reference##
##Adding Aliasing and Passing by Reference##
-Next we'll add aliasing as described at the end of [[week9]]. We'll also add the ability to pass (implicit) reference cells as arguments to a function, which lets changes made within the function body to be effective in the outside environment. When we discussed this in [[week9]], we proposed a different syntactic form for the function values that get called in this way. Instead of:
+Next we'll add aliasing as described at the end of [[week9]]. We'll also add the ability to pass (implicit) reference cells as arguments to a function, which lets changes made within the function body be effective in the outside environment. When we discussed this in [[week9]], we proposed a different syntactic form for the function values that get called in this way. Instead of:
let f = lambda (y) -> ...
...
let f = lambda (y) -> ...
...
in f y
In our present framework, it will be easier to do things differently. We will
in f y
In our present framework, it will be easier to do things differently. We will
-introduce a new syntactic forms at the location where a function value is
-applied, rather than in the function's declaration. So we will say instead:
+introduce a new syntactic form at the location where a function value is
+applied, rather than in the function's declaration. We say:
Let ('f',
Lambda ('y', ...),
...
Apply(Variable 'f', Variable 'x')...)
Let ('f',
Lambda ('y', ...),
...
Apply(Variable 'f', Variable 'x')...)
-for the familiar, passing-by-value behavior, and:
+for the familiar, passing-by-value behavior, and will instead say:
Let ('f',
Lambda ('y', ...),
Let ('f',
Lambda ('y', ...),