CSC151.01 2015S, Class 36: Pairs and Pair Structures
====================================================

* New Partners!

_Overview_

* Preliminaries.
    * Admin.
    * Upcoming Work.
    * Extra Credit.
    * Questions.
* Quiz.
* Lab.
* Debrief.

Preliminaries
-------------

### Admin

* Grades distributed via email.  
    * Yes, I take comments and corrections.
    * No, you can't now do the labs you missed.  
    * As some of you have discovered, I didn't catch all absences, but 
      I caught many, and absences do affect your grade.
    * I have promised a number of people that I will revisit their exam 2
      grade at the end of the semester and see how much of an impact
      dropping it has had.  I will do so for anyone who asks me during
      finals week.

### Upcoming Work

* Lab writeup (paper!): Exercises 1 and 3
* Reading for Tuesday: 
    [Trees](../readings/tree-reading.html)
* HW7 due Tuesday at 10:30.
* Exam 3 distributed Wednesday.

### Extra Credit Opportunities

#### Academic 

* Joe Palca talk Tuesday at 7:30 p.m. in Sebring-Lewis.
* Scholars Convocation Wednesday at noon: Alison Bechdel.
* CS Extras Thursday: ???
* CS Table Friday: ???

#### Peer Support (Afternoon Section)

* EE (and SGAVPAA and IT) talk Tuesday at noon in JRC 101.
* Wednesday at 4:30 in Noyce 1302.  Psychology Alumni Job Talk Series, 
  Alex 'um from ACT.
* How an admitted student this coming Sunday night!  Contact JMU for info.
* Many things the following weeks.
* Womens Tennis Sunday against Central.
* ISO Show, Saturday night 7-9 pm at Harris.  Many live performances.

#### Miscellaneous

_Nothing at present_

### Other Good Things (no extra credit)

* Student research seminar this week.

### Questions

Quiz
----

Lab
---

* Each call to `cons` creates *one* pair.
* Each null is a slash within the corresponding element of the pair
* Each non-null value should have an arrow pointing to it

Debrief
-------

Why do we do this?

* Because I told you to?
* To understand the underlying representation of lists and other structures
  that we sometimes creates.
    * We will be creating more complex structures starting tomorrow.
    * We can finally understand why we get the period for non-lists.
    * In some cases, we can see why lists behave the way they do.

Printing a pair

     Print an open paren
     Print the car
     Loop over the cdr
       cdr is null: print right paren
       cdr is a pair: print the car and do it again with the cdr
       cdr is not a pair: print a period and the cdr and a right paren

Checking listness / writing `listp?`

* A list is either null or a pair of anything and a list.  
* So 
     * Check if the parameter is null
         * Yes -> Done
     * Check if the parameter is a pair
         * No -> Done
         * Yes -> Check if the cdr is a list.  How?  Magic recursion fairy
