CSC151.02 2016S, Class 11: Side Effects: Output and Input
=========================================================

* New partners!  
* Please take a goldenrod card, too.

_Overview_

* Preliminaries.
    * Admin.
    * Upcoming Work.
    * About the Exam.
    * Extra Credit.
    * Questions.
* Lab.

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

### Admin

* I had hoped to shorten the pre-class administrivia today, but with the
  distribution of an exam, that's not possible.
* Apologies for the effects of the MathLAN downtime.  (Yes, it affected
  me, too.)
* I've rearranged the schedule slightly, so you'll need to read over the
  documentation reading for Friday, as well as the "normal"
  Friday reading on testing.
* When you hit more than nine hours outside of class in a week (ten hours
  in an exam week), let me know how you are spending your time so that I
  can try to cut the workload.

### Reminders

* Office hours: MTWF 10-11, Tu 1-2.
    * Sign up at <http://rebelsky.youcanbook.me>.
    * Also feel free to stop by when my door is open.
    * Or to email me for an appointment.
* Tutor hours
    * Sunday, 3-5 p.m.
    * Sunday-Thursday, 7-10 p.m.
* Weekly review sessions:
    * Wednesday at 8pm in the CS Commons with Stupendous Sarah!
    * Thursday at 10am in this room with Sarcastic SamR!
    * Thursday at 8pm in the CS Commons with Amazing Alex.

### Upcoming Work:

* Readings for Friday:
    * [Documenting Your Procedures](../readings/documentation-reading.html)
    * [Testing Your Procedures](../readings/rackunit-rgb-reading.html)
* [Assignment 3](../assignments/assignment.03.html) due tomorrow
  night at 10:30 p.m. (optional, only positive effect on your grade)
* [Exam 1](../assignments/exam.01.html)
  due Tuesday, prologue due Friday night.
* Quiz Friday
    * Defining procedures with `section`
    * Procedures with `lambda`
    * Documentation
    * Order-of-evaluation
    * Simple output (particularly annotating procedures)
    * Some reading ("what does this code do?"), some writing ("write a
      procedure that ...")
* Lab Writeup: Exercise 4
    * Send email titled __CSC 151 Lab Writeup 11 (Your Names)__
    * Do not include the underscores.
    * Send to <CSC151-02-grader@grinnell.edu>
    * Due before class on Monday.

### Exam 1

* We'll take a few minutes to look over exam 1.  
* Please pay particular attention to the [policies](../assignments/preliminaries.01.html).
* Please bring questions on Friday (and Monday, and Tuesday).
* Former students have [tips](../handouts/exam-tips.html)
* Sam will try to make alternate mechanisms for doing the work available by
  Friday.
* EB says that it's good to do work on paper.
* The person from Seattle says that it's good to work in the labs, even if
  you can't talk to anyone.  Suffer together!

### Extra Credit

* Send to <rebelsky@grinnell.edu> with subject "CSC 151 Extra Credit".

#### Academic

* This week's Rosenfield Symposium on Campaign Finance.
* This week's Carnival and Creativity series.
* CS Extras tomorrow: Q&A with alums.
* Convocation next week: Hilary Mason '00 on Data Science and Social Good..
  11 a.m., Thursday, JRC 101.
* CS Extras next week: Hilary Mason on Fast Forward Labs.  Science 3821 at
  4:15 p.m.  (SRO)

#### Peer

* Track and Field February 13. 
* Love Notes.  If the $2 is a stretch, Sam will pay.  Email JS the elder.
* Shanghai Express Saturday at 4:30 p.m. in JRC 101.

#### Regular Peer

* Social Dance Workshop Tuesdays 7:00-8:00 in Bucksbaum Dance Studio
  (starting next week)
* Pun club Saturdays at 4pm in Younker (max 2)
* Socrates Cafe' Saturdays (max 2) email [socratescafe] to be added
  to the mailing list to hear about the top secret meeting location
* Electronic Potpourri on KDIC Fridays at Five

### No Extra Credit, But Still Good

* High School Large Group Speech Presentations Saturday at 6:30 p.m. 
  at the high-school auditorium.  Sam will reimburse you for the $5 entry
  fee (or give it to you in advance).
* Econ department talk on Financial Frication Today at 4pm ARH 102

### Questions

Lab!
----

Important lesson: If you want to watch what a procedure does, you can
make an alternate version of the procedure that calls `display` and
`yield` with a call to the underlying procedure.

    (define square
      (lambda (x)
        (* x x)))

    (define square_*
      (lambda (x)
        (display "squaring ")
        (display x)
        (yield (square x))))

You can then substitute the verbose version so that you know when your
procedure is called (and what it does).  Many programmers find this a
really helpful approach.

In DrRacket, you'll see the `display` output and the returned value in
different colors.  (You can use the computed value; you can't really
use the displayed stuff.)

Since computers and humans deal with values differently, sometimes we
want custom versions of `yield`.

**Writeup: Exercise 4**
