CS212 Problem Sets
FAQ - Problem Set 6

LAST UPDATE: Wednesday, January 19, 2000 11:35 PM

Back by popular demand...  I have very little time to watch the newsgroup, so when official answers come to me by email, I'll post them here.

General Questions

Is defmacro needed for this problem set?

No.

Darn newlines, do you care where they end up?

Not really.

There's a bug (or it seems like a bug) in TS, do I have to worry about it?

If there's a bug in our code with respect to bulletproofing, then you need not worry about it or try to fix it. Just try to make your extensions as bullet-proof as possible.

The sources don't do error checking for something, do I need to be concerned about it?

If the code we provided you does not do some error checking that it should, then don't worry about trying to fix it.

Do I need to error check for primitive functions?

Nope.

It says in the ps6 code that we can "feel free to add more primitives", but how would you guys like this done?

You can change our code for initializing the top-level environment.


Part I

Aren't print and display the same thing?

Yes. You may treat print and display as the same.  The problem set text has changed to reflect this.

I'm having trouble with set!, what's up?

Tiny Scheme does not provide a general set! as in Swindle.  In particular, set! only operates on variables. set-car! and set-cdr! only operate on lists.  If you get ambitious, you can modify the compiler so that it maps

(set! (car e1) e2) to (set-car! e1 e2)

and

(set! (cdr e1) e2) to (set-cdr! e1 e2)

But you don't need to.

What type of things do we need to check with set-car! and set-cdr!?

You should check that set-car! and set-cdr! are applied to two expressions in the compiler.  It isn't possible to determine that the first expression always evaluates to a pair within the compiler so you need not check this.


Part II

Does all the error msg need is to identify which keyword (or function) was the one that triggered the error?

This would be sufficient.


Part III

No questions asked yet!


Part IV

Should we deal with a defstruct that defines no fields?

Indeed, you must consider this.


Part V

No questions asked yet!