Home Assignments Lecture Blog Resources Project Discussion Group

91.301 Organization of Programming Languages
Prof. F. Martin

Out: Apr 27, 2011
Due: May 2, 2011

Problem Set 9: The Metacircular Evaluator


In this problem set, you’ll make modifications to the metacircular evaluator, changing UML Scheme (aka, "baby scheme").

To run the metacircular evaluator, download from the course web site. Note: you must run it with the R5RS language—select “Choose Language...” from the pop-up menu in the lower-left corner of a main Racket window.

After evaluating the code buffer, evaluate (mc-eval-loop) in the REPL. This will run the interactions for your metacircular UML Scheme world. Remember that everything you type in (except for variables and numbers) should be prefixed by “uml:” – if you forget, the system will have an error. If you type in an error, the driver-loop exits and you will lose the state you had in the metacircular world.

You only need to turn in the portions of the code that you change. Turn in a code file with submit fredm 301-ps9 <your-file>.

Warm-up: Run the metacircular evaluator and evaluate some UML Scheme expressions. Nothing to turn in for this part.

Note: for all problems, make sure to all turn in the expressions you evaluated inside your meta-circular evaluator that demonstrate that your implementations are functional! 50% of the credit will be for a correct implementation, and the remaining 50% is for correctly demonstrating that your code works. Thank you.

Problem 1: Exercise 4.4 (“or” only) on p. 374. Remember to name your new “or” as “uml:or”.

Problem 2: Exercise 4.1 on p. 368.

Problem 3: Problem 3 has been removed from the PS.

Problem 4: Exercise 4.9 on p. 376. Pick one of the iteration constructs (do, for, while or until) to implement.