CSC151 2015S, Class 35: Geometric Art Through Numeric Recursion
===============================================================

* Same Partners!

_Overview_

* Preliminaries.
    * Admin.
    * Upcoming Work.
    * Extra Credit.
    * Questions.
* Quick notes on named let.
* Quiz!
* Lab.

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

### Admin

* Note: Every eboard *should* remain available and linked.
* Friday PSA.
    * Remember that the Romans were paragons of moderate behavior.
    * Alternately: Remember that Rome fell.
    * Please take care of yourselves and your colleagues.

### Upcoming Work

* Lab writeup: Exercise 5.  (Posted during quiz.)
  <http://bit.ly/151-2015S-lab35>
* Reading for Monday: 
    [Pairs and Pair Structures](../readings/pairs-reading.html)
* HW7 due Tuesday.  Choose your own partners.

### Extra Credit Opportunities

#### Academic 

* Scholars Convocation Wednesday: Alison Bechdel.
* CS Table today: Therac 25.

#### Peer Support (Morning Section)

* Julia's radio show, "The Hot Box".  Wednesday night/Thursday morning 
  1:00-2:00 a.m.  
* KY thinks she's funny Monday from 9-10.
* Host an admitted student!  Talk to JMU for information.

#### Miscellaneous

### Other Good Things (no extra credit)

### Questions

Quick notes on named let
------------------------

Situation: Writing a helper procedure using what Sam calls the "column
model"

* I want to tally all the numbers in a list.

        tally   remaining

* Example: Tally the numbers in the list (list 1 'two "three" 4.0)

        tally   remaining
        -----   ---------
        0       (list 1 'two "three" 4.0) ; first thing is a number
          add 1   throw away the 1
        1       (list 'two "three" 4.0) ; first thing is a symbol
          keep    throw away the 'two
        1       (list "three" 4.0) ; first thing is a symbol

* Generalize
        tally   remaining
        -----   ---------
        0       lst

* Turn into code

        (define tally-numbers
          (lambda (lst)
            (letrec ([kernel (lambda (tally remaining)
                               (cond
                                 [(null? remaining)
                                  tally]
                                 ...))])
               (kernel 0 lst))))

* This looks significantly different than what we wrote in designing
  the solution. our solution tied the column names to the initial
  values; this separates them.  As language designers, we can build
  something better

        (define tally-numbers
          (lambda (lst)
            (let kernel ([tally 0]
                         [remaining lst])
               (cond 
                 [(null? remaining)
                  tally]
                 ...))))

Quiz
----

* Feel free to set up the lab while waiting for your partner.
* Warning!  Central campus at noonish may be disturbing.
* A note on the extra credit.  Think about the spiral example.

Lab
---

* Make sure to use a relatively small brush.  For example,

        (context-set-brush! "2. Hardness 100" 2)





