Com S 342 --- Principles of Programming Languages EXERCISE 01: SCHEME BASICS AND PROCEDURES (File $Date: 2005/01/18 16:46:14 $) The purpose of this exercise is for you to learn how to work with simple lists in Scheme. As with all exercises, this is to be done individually. It is due the day this topic is planned to be discussed in class (see the syllabus: http://www.cs.iastate.edu/~cs342/syllabus.shtml). We expect this to help you think about the readings (see below). If you don't have an answer or an answer that you think is good, write down what you read, and a question or two that would have helped you make progress. Then you can ask that question in class; there will be other people with the same problem, and everyone can learn by discussing these issues. And you'll most likely see similar things on the homework, so it's best to understand them now. 1. [Basics of Lists] Read chapter 1 of the "Little Schemer" (4th ed., 1996) by Friedman and Felleisen. Make a transcript for the following, and hand in a printout of your transcript. On the transcript identify the following. a. Give a Scheme expression that returns the list (()). b. Give a Scheme expression that returns the list (part-b ()). c. Give a Scheme expression that returns the list ((part-c ()) part-b ()). Suppose now that the-list is defined to be (part-d (part-e) ((x part-f))) as in (define the-list '(part-d (part-e) ((x part-f)))) d. Write an expression using only the-list, car, cdr, and calls that returns the symbol part-d. e. Write an expression using only the-list, car, cdr, and calls that returns the symbol part-e. f. Write an expression using only the-list, car, cdr, and calls that returns the symbol part-f. WHAT TO HAND IN You should have at the beginning of class, written answers to the above questions (or written out questions and problems you encountered for each part). Make sure your name is on these. Attach the printouts, if any, requested above. ADDITIONAL READINGS If you have time, read pages 1-31 (up to the start of section 1.2) of the recommended textbook "Structure and Interpretation of Computer Programs", by Abelson and Sussman, which is on reserve and also on-line at the following URL. http://mitpress.mit.edu/sicp/