EBoard 09: Lists

Approximate overview

  • Pretty pictures [5-10 min]
  • Administrative stuff + Q&A [10-20 min]
  • Lab [Remaining time]

Pretty pictures

  • Probably on Sam’s MacBook
  • Good job folks!
  • Or perhaps “excessive job, folks”

Administrative stuff

Introductory Notes

  • I hope things are going well.
  • Please consider how you treat your partner, particularly when there are knowledge or power imbalances.
  • Note that “We have to rush to get this done” disadvantages those who need a bit more time to process material.
  • Sam forgot his hearing aids. He will be even less able to understand you than normal.

Upcoming activities

Events

  • Mentor sessions Wednesday 7pm
  • Football Saturday at 2pm
  • Mentor session Sunday at 4pm

Process

  • Please send reflections within a few days of the event.
  • Reflections do not just report; they include (emphasize even) your reactions.

Upcoming work

Q&A

Where did the names of the computers come from?

Famous dead computer scientists.

Before ITS got even more paranoid, you used to be able to connect to each computer on the Web and see a bio of the computer scientist.

Reminder to self: Perhaps that info belongs on www.cs.grinnell.edu.

How do we use test-true for procedures that do not return a Boolean?

Consider trim. You can write
(test-true "no spaces" (equal? (trim "Hello") "Hello"))

What do you mean “by magic numbers like 48”?

;;; (digit->num ch) -> integer?
;;;    ch : character? (in the range #\0 to #\9)
;;; Convert a character digit to the corresponding integer.
(define digit->num
  (lambda (digit)
    (- (char->integer digit) 48)))

This is more readable as

(define collation-number-for-digits 48)
(define digit->num
  (lambda (digit)
    (- (char->integer digit) collation-number-for-digits)))

Or

(define digit->num
  (lambda (digit)
    (- (char->integer digit) (char->integer #\0))))

That suggests that we’re offsetting from zero, which should give us the value of the digit (if they are stored in reasonable order in the collating sequence).

It also works if we switch collating sequences.

Lab

Notes entering lab

  • Don’t forget to discuss working habits or anything else.

Notes during lab

Don’t spend too much time on the “other list procedures”.

It’s nice to see some of you diagramming out what should happen in the exercise 3 algorithm.

Eamon says, “Wow, that’s not how I would have solved problem 3. This is a very different way of thinking.” Sam says, “Yes, that’s the point; we’re trying to stretch their brains.”

Problem 6 is optional.

Yes, you have to finish this outside of class. But you can have until Monday. Please try to find a time to meet with your partners.

Prof. J says, “Sam may be terrifying, but students should still ask questions and not push forward on their own.”

Things Sam forgot to say

  • If your religious obligations for tomorrow make it difficult to get MP2, the lab, or the reading done, just let me know.