# SICP Solutions

### Chapter 3, Modularity, Objects, and State

#### Exercise 3.33

Output:

Note that when some error occurs, MIT scheme keep showing it in prompt unless (restart 1) is called.

There is one important aspect that caused me some time to understand - Ownership

Any one can set a connector if it has no value. But if there is a value set in it then only that user/code is able to forget that value. This is a good idea - one who sets is responsible to remove. It makes easier to debug things if something goes wrong.

Note that in the above example - when (forget-value! a 'ovais) is invoked, the value of b is not forgoten - because it was not set my the squarer procedure! But it was set me user- ‘ovais.

I am also putting the complete code here for future reference: