On slide 23 we have the following code:
Code: Alles auswählen
(local ((define a (box 1)))
(local ((define f (lambda (x) (+ x (unbox a)))))
(begin
(set-box! a 2)
(f 5))))
On slide 24 it's written (concerning the same piece of code) "Static scoping rules for function application will defeat environment-passing style"
My question: Why?

Isn't this just what we wanted to implement? Having a sequence where a first expression may affect the second one? I don't see any disadvantage resulting of schemes static scoping, in my opinion the "dynamic scoping of the set-box!" leads to this result....and this is exactly the result we want to have. If we'd have strict static scoping we would have 6 as the result.
Due to this problem I don't really see a reason for introducing the store-passing style.
Can anyone help here?