CS 251: Programming Languages

Spring 2018

Exam 1 information

1. Notes

You are permitted one letter-size handwritten notes sheet (both sides) for use as a reference during the exam.

2. How to study

Lots of research has shown that reading over material isn't a very good way to prepare for exams. The best thing to do is to practice. Reading how to swing a baseball bat or how to cross-country ski might give you some good ideas on how to get better the next time you try it, but it's not even close to just getting out there and swinging a bat or skiing in the Arb.

How can you practice? Go back to look at the homework problems. Can you do them from scratch on paper? This website and this website contain long lists of exercises, though they don't focus much on the more abstract concepts. Here are more, which seem to include some content that the other sites are missing. Practice these under test conditions and see how you do. Even though the solutions may not be available, just trying to do them can be incredibly useful. The ones that involve programming you can put into the computer to see if they work. Otherwise, you can work with other students to see if you think you've got the right answers. Even if you don't know for sure if you've got the right answer, just practicing with these exercises can be helpful.

Finally, make sure to do all of your practicing on paper, not at a keyboard, so as to simulate the exam conditions.

Recall that it is against the academic integrity policy to seek out resources from past versions of this course or similar courses offered elsewhere.

3. Exam content

The exam covers everything we have done, except the recursive substitution model (which will be covered on the next exam).

In particular, besides the basics, major topics we've focused on in class includes tail recursion and higher-order functions (map, filter, foldl, and foldr). In homework, you've worked with some data structures (BSTs, lazy lists) and more higher-order functions (currying, composing, etc.). These are all concepts students should be able to use and reason about.

Students should be able to write Scheme functions on paper to do specified tasks. In particular, students should be able to successfully make significant use of recursion, and write functions that are tail-recursive (and identify whether a function is tail-recursive). As in the homework, any Scheme code should be written in a purely functional style (no side effects like set!).

As usual, please note that this document is not a contract. I may have inadvertently left something off that ends up on an exam question. Moreover, I will not be able to test all of this material given the time limitations of the exam. I will have to pick and choose some subset of it.