At the end of class Friday I announced this assignment.  Here are the details:

 

Point value: 20 HW points.

Due:  Before your CSSE 304 class on Monday.

Deliverable:  Complete the  transformation of flatten-cps and related procedures to data-structure representation of continuations; test and debug the code.

Scope: You should only have to  add/delete/modify about8 lines of code.

Submit working code to:  Drop box on Moodle.

Files Starting code    Code in the state we left it in

Suggestion: Open the starting code file, and try to repeat what we did in class without looking at your notes from today.  If you get stuck, look at your notes. 

Details:

In class today we began converting flatten-cps and related procedures from the original CPS style in which continuations are represented by procedures to the new CPS style in which continuations are represented by variant records implemented using define-datatype.

 

We converted three of the four continuations in the original code, with one exception.  The last line of the flatten-car-k variant in the apply-k procedure has a call to append-cps.  The arguments u and v were copied from the original code, but are not correct in the new context.  You need to replace u and v with the correct arguments.

 

Then you need to do the conversion process for the append-cps procedure.

 

Test and debug the code:

·         Load the file into scheme.

·         Run (read-flatten-print).

·         Enter various s-list expressions to make sure that your code works.