University of Toronto - Fall 2002 Department of Computer Science

CSC 324: Principles of Programming Languages

Project 1: Scheme

Project 1 handout.

Starter code.

Sample unit testing: input file and the corresponding output file.
Sample system testing: input file and the corresponding output file.

Scheme references and downloads

Alex's project 1 marking comments, and the marking codes he used.

Project clarifications and corrections

As for the problem sets, most questions will be answered on the newsgroup, but important clarifications, and any corrections to the specifications, will be posted here.

October 23: FAQ: Does resolve-bindings have to print the internal error message when it finds an unbound symbol despite the fact that its preconditions disallow unbound symbols? Answer: yes! This message should be printed when the precondition is violated, for the purpose of unit testing.

October 22: This is the most frequently asked question: how can you get validate-bindings to continue going through the expression after finding one unbound symbol? The problem is that and does short-circuit evaluation, so when its first argument is false, it doesn't evaluate the remaining. The fix? Hint: there is a construct in Scheme that forces the evaluation of a series of expression before performing some operation on it? (Actually, there are several such constructs.) Use it.

October 20: The message Unknown statement type should not appear in your system, as specified in the handout. It was only there so that the starter code could run on its own.

October 20: Typo: In the handout, it says Undefined variable, but the starter code produces Undefined symbol. The starter code is correct; the handout should have said Undefined symbol.

October 17: Another (small) error in the starter code was pointed out to me in the evening section's lecture. When you call display-error more than once for the same expression, an extra space is inserted before the second and next messages. The problem is actually with display-all. It's fixed now. Please download the new version of the starter code and copy and paste the definition of display-all into your code.

October 17: In your unit testing suite for get-binding, you may use set-binding to set things up before calling get-binding, in order to demonstrate that the two work correctly together.

October 15: As you work on the project, you may want to try edwin. On CDF, you can start edwin using the command scheme -edwin -edit. Type C-h m for some basic commands. This gives you a friendlier environment to test your procedures in, although it doesn't interact very well with run, so I wouldn't use it to test your interactive system.

October 15: You should not need to use quasiquote and unquote in your project at all. I only used it in the starter code as a convenient way to hard-code a binding list, but when you deal with the user's input, you should never need to use those constructs. (Sorry if this has been a source of confusion.)

October 14: Don't forget, you must provide brief documentation and preconditions for all procedures you write, including the ones specified in the handout. (If a procedure doesn't have any preconditions at all, it is ok to leave out Pre: none, although it remains preferable to write even that, so we know you thought about it.)

October 13: The starter code was just updated to include a fix to builtin?. Please re-download the starter code, or replace the definition of builtin? in your code with the new one.

October 9: Just as resolve-bindings does, validate-bindings should accept Scheme built-in procedures as defined. Use builtin?, provided in the starter code, to determine if a symbol is bound to a built-in procedure.