CSC151.01 2014F, Class 40: Vectors
==================================

_Overview_

* Preliminaries.
    * Admin.
    * Upcoming Work.
    * Extra Credit.
    * Questions.
* Reading check.
* Behind the scenes: How Scheme implements vectors.
* Lab.

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

### Admin

* New partners (some cards may be missing, so we'll adapt)!
* Review sessions
    * Tonight at 8pm with Alex
    * Tomorrow at 8pm with Ajuna
    * Tomorrow at 10am with SamR

### Upcoming Work

* Lab writeup: Exercise 5, <http://bit.ly/151-2014F-w40>
* Readings for Friday:
    * [Randomized Drawing](../readings/random-drawing-reading.html)
* *Required* exam epilogue due tonight.
      <http://bit.ly/151-2014F-exam3epi>
* Part one of the project due next Monday night.
    * Sketches due in class on Tuesday.
* Study for quiz!

### Extra Credit Opportunities

#### Academic

* Scholars' Convocation, noon, today: Dean Latham.
* Town Hall Thursday on Sustainability, noon and 7:30 p.m. (I think)
* CS Table Friday: Shellshock

#### Peer Support

* Football, Saturday at noon vs. Lawrence.
* YGB, Saturday at 7:30, See, Bring, Lou, Us
* Karan's radio show 11pm Thursday nights on KDIC
* Evan's radio show 5pm Friday nights on KDIC
* Donna's radio show Sunday midnight on KDIC

### Questions

_How do I do other cool things with GIMP/gigls?_

> There's a huge list of procedures under Help -> Procedure Browser.
  You can call most of them, although the arguments are a bit strange
  in some cases.

Reading check
-------------

With your partner:

* Most important points of the reading
* Confusing issues

Most important points

_Why do vectors in addition to lists?_

> Sometimes we want quick access to values; lists are slow, vectors
  are fast (by index).

> Vectors let you change their contents.

_Why have lists if we have vectors?_

> Lists can be expanded easily; vectors can't.

> Lists are really easy to recurse over.

_Huge number of procedures_

Confusing issues

_Why would you ever want `vector-fill!` (particularly given that we 
 could just use make-vector)?_

> Mostly there to help you think about recursion over vectors. 

_How do we make vectors bigger?_

> You can't.

_What's a number vector?_

> A vector that contains only number.

Behind the scenes: How Scheme implements vectors
------------------------------------------------

Laid out in a continuous area of memory.  Let's say it starts at
location *m*.  Every value takes the same amount of space, *s*.  That
means that value *i* is at position *m*+*si*.

Lab
---

* Why do we have `vector-fill?` answered: We can't redefine things.  Hence,
  if we want to change them, changing in place is the way to go.
* Two approaches to `vector-sum`, just like there are two approaches
  to the normal `sum`.  You can use direct recursion or you can use
  a helper.
* I like that many of you are finding a similar procedure and then
  just changing the appropriate parts.
