EBoard 18: Pause for breath - Lists and MP3 (Section 1)

Please follow the standard start-of-class routine.

Warning! You are being recorded (and transcribed) (provided the technology is working correctly).

Approximate overview

  • LAs
  • Administrative stuff
  • Q&A
  • About MP3
  • Review
    • A question from MP2
    • Using lambda-free procedures with lists
  • Time to work on MP3
  • More LAs

Administrative stuff

Introductory Notes

  • Grades distributed last night. Let me know if there are questions.
    • I have not yet updated the tokens and attendance.
    • Our graders are still working on the last two labs and the MP1 redo.
  • I will be unavailable next Thursday. Tuesday is my primary day for office hours, but I can try to find times between classes on Monday, Wednesday, and Friday.

Upcoming work

  • Due Sunday, 2026-10-11
  • Due Tuesday, 2026-10-13
    • Readings:
      • Local bindings
      • Gradescope not yet ready
      • The reading is not yet updated for Scamper.
  • Due Thursday, 2026-10-15
  • On Friday, 2026-09-16
    • NEW Quiz/LA on testing (one of Monday’s topics)
    • NEW Quiz/LA on local bindings (Wednesday’s topic)
    • Makeup Quiz/LA on collaboration (hopefully not)
    • Makeup Quiz/LA on lists and list operations
    • Makeup Quiz/LA on conditionals
    • Makeup Quiz/LA on compose, cut, and section
    • Makeup Quiz/LA on tracing
    • Makeup Quiz/LA on decomposition (hopefully not)
    • Makeup Quiz/LA on procedures (hopefully not)
  • Due Tuesday, 2026-10-27
    • Mini-project 2 redo
      • Submit redo on Gradescope (forthcoming)
      • When submitting a mini-project redo, please include a file called CHANGES.txt that describes what you’ve changed.
      • Please add the following line to the top of your file. (export ...).
      • I’m working on an autograder for the redo, so the Gradescope won’t be available until over the weekend.

Upcoming activities

Scholarly

  • Tuesday, 13 October 2026, Noon–1:00 p.m., CS Commons. CS Table
  • Thursday, 15 October 2026, 11:00 a.m.–noon, JRC 101. Scholars’ Convocation: Unknown Topic

Artistic/Cultural

  • Any day. Visit the GCMOA for at least 30 minutes.

Multicultural

  • Friday, 9 October 2026, 4:10–5:00 p.m., HSSC N1170 Middle of Everywhere (Uganda)
  • Saturday, 10 October 2026, 3:00–5:00 p.m., JRC 101. Walking Tacos with SOL

Peer

Musical, theatric, sporting, academic, and similar events involving this section’s students are welcome.

Wellness

  • Friday, 9 October 2026, 11 a.m.–noon, Kington Plaza or JRC 101. Mental Health & Wellness Resource Fair
    • Stop by for as long as you think is appropriate.
  • Saturday, 10 October 2026, Evening. Participate in 10/10 with moderation.
    • Moderation: No more than two normal-size alcoholic drinks. (E.g., one shot, 12/16 oz of beer, 5 oz of wine.)
  • Monday, 12 October 2026, 8:00–9:00 p.m., Prayer Garage in the CRSSJ. Meditation Group
  • Tuesday, 13 October 2026, 4:30–6:00 p.m., Bear P103. Wellness Yoga
  • Wednesday, 14 October 2026, 4:15–5:45 p.m., Undisclosed Location. Forest Bathing

Misc

  • Wednesday, 14 October 2026, 8:00–9:00 p.m., Science 3820. Mentor Session
  • Thursday, 15 October 2026, 8:00–9:00 p.m., Science 3820. Mentor Session

Other good things

These do not earn tokens, but are worth your consideration.

  • Friday, 9 October 2026, 7:00–9:00 p.m., Darby. Volleyball vs. Knox
  • Saturday, 10 October 2026, 1:00–3:00 p.m., Darby. Volleyball vs. Illinois

Friday PSA

  • Please be moderate this weekend.
  • Do not feel you have to follow DAMN STUPID EXPECTATIONS.
  • Consent is essential. It is also insufficient. And impossible when impaired.

Questions

I have credit for all seven LAs. What should I do during LA time?

You can choose to leave or to work on MP3.

Do we have new work to do over break?

No.

There’s not even a reading due at the end of break.

However, you may find that you want to use break to catch up. For example, you might work on redos, you might try to memorize some “vocabulary”, you might complete some of the labs that you didn’t complete.

I wish we had more time in class to complete labs. Would that be possible?

I try to balance talking with lab time. Some folks need a bit more talking, some need a bit more doing. If you want more lab time, you can always do labs here with a friend and the evening tutors. (Sorry, I know that’s not the best answer.)

I’d like to leave early for fall break. Do I have to show up next Friday?

You will miss the opportunity to take LAs.

You must let me know that you won’t be here.

We’ll all miss you.

But it’s up to you.

About MP3

Central themes

  • Working with lists
    • To create and process collections of things
    • To put data together to represent one thing
  • Building non-representational images by combining lots and lots and lots of shapes that we build “systematically”

A question from MP2

I’ve written gamma-correct-color, but I struggled to write gamma-correct-half and gamma-correct-double. The evening tutor “helped” me write a complicated solution. Can we talk about it? I think it will help me better understand section and compose.

;;; (gamma-correct-color color gamma) -> color?
;;;   color : rgb?
;;;   gamma : number?
;;; Gamma correct the color by the given amount. You can read
;;; "the literature" for the details.

;;; (gamma-correct-half canvas) -> canvas?
;;;   canvas : canvas?
;;; Gamma correct each of the pixels in `canvas` by 1/2

;;; (gamma-correct-double canvas) -> canvas?
;;;   canvas : canvas?
;;; Gamma correct each of the pixels in `canvas` by 2
  • Hmmm. pixel-map needs a one-parameter function as its first parameter, but gamma-correct expects two.
  • I know! I’ll write a one-parameter variant that gamma corrects by 1/2
(define gch
  (lambda (color)
    (gamma-correct color 0.5)))

(define gamma-correct-half
  (lambda (image)
    (pixel-map gch image)))

This is not much different than defining rgb-bluer ourselves and then using it with pixel-map.

(define image-bluer
  (lambda (image)
    (pixel-map rgb-bluer image)))
(define gcdouble
  (lambda (color)
    (gamma-correct color 2)))

(define gamma-correct-double
  (lambda (image)
    (pixel-map gcdouble image)))

At some point, you get used to using l-s and r-s (not necessarily on this assignment).

gch is taking a two-parameter procedure (gamma-correct) and filling in one of the parameters (the second/right) with a constant (0.5). We can use r-s to do the same thing.

(define gch
  (r-s gamma-correct 0.5))

We know that Scamper often just does substitution for defined values.

(define gamma-correct-half
  (lambda (image)
    (pixel-map (r-s gamma-correct 0.5) image)))

If we prefer lambda, we cold also write.

(define gamma-correct-half
  (lambda (image)
    (pixel-map (lambda (color) (gamma-correct color 0.5)) image)))

We can write gamma-correct-double similarly.

(define gamma-correct-double
  (lambda (image)
    (pixel-map (r-s gamma-correct 2.0) image)))

Wow. I have two nearly identical procedures. I want to “factor out” the commonality.

(define gamma-correct-image
  (lambda (image amt)
    (pixel-map (r-s gamma-correct amt) image)))
(define gamma-correct-half
  (lambda (image)
    (gamma-correct-image image 0.5)))

(define gamma-correct-double
  (lambda (image)
    (gamma-correct-image image 2.0)))

Taking one more step …

(define gamma-correct-half
  (r-s gamma-correct-image 0.5))
(define gamma-correct-double
  (r-s gamma-correct-image 2.0))

Lists, “the big three”, and anonymous procedures

Time to work on MP3

LAs and Quizzes