Topics for Exam 1 in Com S 342 This test covers topics from homeworks 0 and 1. REMINDERS This test is closed book and notes. (Although later tests will allow you to use a page of notes, for the basics of Scheme, we want you to know these ideas.) If you need more space, use the back of a page. Note when you do that on the front. This test is timed. We will not grade your test if you try to take more than the time allowed. Therefore, before you begin, please take a moment to look over the entire test so that you can budget your time. For programs, indentation is important to us for ``clarity'' points; if your code is sloppy or hard to read, you will lose points. Correct syntax also matters. Check your code over for syntax errors. You will lose points if your code has syntax errors. READINGS For homework 0: Class language design discussion Related to this discussion you should read pages 1-16 of the recommended textbook Structure and Interpretation of Computer Programs, by Abelson and Sussman, which is on reserve and also on-line at http://mitpress.mit.edu/sicp/. For a reference on Scheme, see the Revised^5 Report on Scheme, which is available in several formats from the course resources web page. For homework 1: Structure And Interpretation Of Computer Programs (Sections 1.1.1-1.1.6, 2.2.1-2.2.2, and 2.3.1) The Little Schemer (p. xiii, chapters 1-2) Revised^5 Report On The Algorithmic Language Scheme (Sections 1 [Overview], and 6.1-6.3 [Standard Procedures]) TOPICS Topics marked + below are more important than topics marked - below. In general, things that are more like the homework will be more important. * Language design, goals + Means of computation, combination, and abstraction. + You should be able to give examples of these in Simple, Scheme and Java. + Design goals of Simple vs. Java (and C++) + What are the design goals of Simple? + Why the data types were included in Simple or excluded + How did they influence the design and syntax of Simple? + What are the design goals of Java? + How did they influence the design and syntax of Java? + Differences between Java and Scheme syntax (if, begin, calls) + Static vs. dynamic type checking + advantages and disadvantages of each + how each matches design goals of Simple/Scheme vs. Java/C++ + expressiveness of data types - Special forms - if expressions - regularity of a language * Scheme ** data types - how to describe abstract data types: abstract values, external form, literals, operations, special forms + built-in types in Scheme, especially booleans, lists, numbers, and symbols - (other types, e.g., strings, vectors are less important) - (you don't need to know all the details of operations we haven't used in homework) - dot-notation - read dot-notation - translate back and forth between dot and list notation ** Expressions + translate algebraic notation into Scheme notation + write Scheme code to: + give definitions + compute conditionals (using if or cond) + make symbols + construct and lists and pairs (improper lists) using either cons, or list, and numbers and quoted symbols + draw box and pointer diagrams + extract parts of lists (and improper lists) + evaluate expressions using define, cons, car, cdr, list, eq?, equal?, etc. + Know when to use eq? vs. equals? - explain the difference between strings and symbols in Scheme - explain the difference between vectors and lists in Scheme - procedure terminology: procedure (Scheme), function (math), application, combination operator, operand, subexpressions, arguments, actual parameters, actuals, parameters - read-eval-print loop ** procedures - what lambda does * programming in Scheme ++ Write Scheme procedures that: + extract and rearrange parts of a list [yodaize example in class] + recursively test the elements of a list for some property [all-numbers, occurs-twice]