# SICP Solutions

### Chapter 5, Computing with Register Machines

#### Exercise 5.24

Few things to note:

• ev-sequence reads from unev. Thus before jumping to ev-sequence we need to set unev with the cond-actions to be executed.
• eve-sequence itself pops from stack to read continue, thus we need to make sure that top of stack contains correct continue.
• To iterate clauses, i used car and cdr. Ideally they should be abstracted with methods like first-clause and rest-clauses.
• At present, error is logged in this case only: If else is not last clause, then error is reported only when the control reaches the else clause. Else if there is some expression that evaluated to true before else, then no error is logged.
• If no clause, evaluates to true, false is returned.
• Add the procedures like not, null?, car, cond-predicate, cond-else-clause? etc in the list of operations while creating eceval.

Example/Output: