EBoard 30: Structured Types (Section 3)
Warning! You are being recorded and transcribed, provided the technology
is working correctly.
Approximate optimistic overview
- Administrative stuff
- A few notes from last class
- Q&A
- Lab
- Quiz
Administrative stuff
Introductory notes
- A fascinating email: “Dear Sam, I’m prioritizing a homework assignment
in another class over showing up for CSC-151. But I’d like to take the
quiz. So I’m going to show up for another section’s quiz time.”
- MP6 is now graded. Our graders are rapidly finishing redos of MP4 and
MP5. I’m going to leave the due dates for the redos as they are, but
set up a free late redo.
Upcoming activities
Scholarly
- Thursday, 17 April 2025, 11:00 a.m.–noon, HSSC 1231 (Multipurpose Kernel).
Scholars’ Convocation: Barrett Klein on The Insect Epiphany: How our six legged allies shape human culture
- Tuesday, 22 April 2025, noon–1pm, White PDR.
CS Table: ???
Artistic
- Thursday, 17 April 2025, 4:00–6:00 p.m., Bucksbaum 104 and beyond.
BAX Opening Reception and Awards
- Any visit to BAX of 15 minutes or more would also count.
- Thursday, 17 April 2025, 7:00–8:00 p.m., HSSC A1231 (Multipurpose Kernel).
Meet Emma Schaefer ‘23 (Listening At Dawn: Music That Heals the Planet)
- Thursday, 17 April 2025, 7:30–8:30 p.m., Sebring-Lewis.
Fresh Flutes Concert
- Thursday, 17 April 2025, 8:00–9:30 p.m., Bob’s Underground.
Poetry Night
- Saturday, 19 April 2025, Noon–4:00 p.m., Central Campus.
SpringFest
- Saturday, 19 April 2025, 7:30–9:30 p.m., Harris Concert Hall.
Titular Head
- Monday, 21 April 2025, 4:00–5:00 p.m., GCMoA.
Poetry Reading by Lívia Stein Freitas
Multicultural
- Friday, 18 April 2025, 4:00–5:00 p.m., HSSC N1170 (Global Living Room).
Middle of Everywhere: Northern & Southern China on a Plate (Breakfast)
- Friday, 18 April 2025, 6:00 p.m.–Midnight, Harris Gym.
SOL Quinceañera
- Tickets are required for the food.
- Saturday, 19 April 2025, 1:00–4:00 p.m., HSSC A1231 (Multi-purpose Kernel).
Japanese Spring Festival
- Saturday, 26 April 2025, 1:00–8:30 p.m., Cleveland Beach.
Holi
Peer
Musical, theatric, sporting, and academic events involving this section’s
students are welcome.
- Read articles by your fellow CSC-151 students and comment on them online.
Wellness
- Tuesday, 22 April 2025, 4:30–6:30 p.m.,
BRAC P103 (Multipurpose Dance Studio).
Wellness Yoga.
- Wednesday, 16 April 2025, 6:30–8:00 p.m., Dance Studio.
Brazilian Jiu-Jitsu
- Thursday, 17 April 2025, 12:00–12:45 p.m., Dance Studio.
HIIT Training.
- Thursday, 17 April 2025. 4:30–6:30 p.m., Off Campus.
Forest Bathing.
- Friday, 18 April 2025, 6:00–8:00 p.m., Aux Gym.
Badminton Club (Smash that bird!)
- Friday, 18 April 2025, 6:30–8:00 p.m. Dance Studio.
Brazilian Jiu-Jitsu
- Friday, 18 April 2025, 9:00 p.m., Noyce Elbow.
Nerf at Noyce.
- Saturday, 19 April 2025, 4:00–6:00 p.m., Aux Gym.
Badminton Club (Smash that bird!)
- Monday, 21 April 2025, 6:30–8:00 p.m. Dance Studio.
Brazilian Jiu-Jitsu
- Tuesday, 22 April 2025, 12:00–12:45 p.m., Dance Studio.
HIIT Training.
- Tuesday, 22 April 2025, 12:15–12:50 p.m., GCMoA.
Yoga in the Museum.
- Tuesday, 29 April 2025, 5:00–6:00 p.m., HSSC Atrium.
Therapy Dogs.
- Tuesday, 29 April 2025, 7:15–8:15 p.m., HSSC Atrium.
Therapy Dogs.
Misc
- Wednesday, 16 April 2025, Noon–1:00 p.m., HSSC A2231 (Auditorium)
Community Forum
- “Weekly discussion on legal protections and recourse on issues
that higher education and Grinnell College face.”
- Also online.
- This week (I think): Student Privacy (FERPA and HIPAA)
- Wednesday, 16 April 2025, 6:30–7:30 p.m., JRC 101.
Building your network
- Thursday, 17 April 2025, 8:00–10:00 p.m., Herrick.
All-Campus Teach In
- Sunday, 20 April 2025, 7:30–8:30 p.m., Science 3819.
Mentor Session: SoLA 3
- Tuesday, 22 April 2025, 7:00–8:00 p.m., Science 3820.
Mentor Session
Other good things
These do not earn tokens, but are worth your consideration.
- Saturday, 19 April 2025, 9:00 a.m.–Noon, Tennis Courts.
Men’s Tennis vs. Ripon
- Saturday, 19 April 2025, 3:00–6:00 p.m., Tennis Courts.
Men’s Tennis vs. Lawrence
Upcoming work
- Wednesday, 16 April 2025
- Quiz: Dictionaries
- Makeup quiz: Diagramming structures (paper only)
- Don’t forget that you can bring a page of _hand written notes for
each quiz._
- Thursday, 17 April 2025
- Friday, 18 April 2025
- Sunday, 20 April 2025
- Monday, 21 April 2025
- SoLA 3 distributed
- Topics from phase one: Decomposition, Primitive types, Collaboration,
Lambda-free anonymous procedures (aka cut and compose).
- Topics from phase two: Conditionals, Documentation, Testing,
Lists (and “the big three”), Program Style, Ethical Considerations
- Topics from phrase three you’ve done quizzes on: List recursion,
local bindings.
- New topics from phase three: Numeric recursion, vectors, randomness.
- Thursday, 24 April 2025
- SoLA 3 due
- Topics from phase one:
Decomposition,
Primitive types,
Collaboration,
Lambda-free anonymous procedures (aka cut and compose).
- Topics from phase two:
Conditionals,
Documentation,
Testing,
Lists (and “the big three”),
Program Style,
Ethical Considerations.
- Topics from phrase three you’ve done quizzes on:
List recursion,
local bindings.
- New topics from phase three:
Numeric recursion,
Vectors,
Randomness
- Sunday, 27 April 2025
- Submit first redo for MP7 on Gradescope
- Friday, 16 May 2025
- Submit final redo for MP1 on Gradescope
- Submit final redo for MP2 on Gradescope
- Submit final redo for MP3 on Gradescope
- Submit final redo for MP4 on Gradescope
- Submit final redo for MP5 on Gradescope
A few notes from last class
- Key idea: We want to abstract away from the underlying representation
of the data. If we access data in a compound object only through
procedures, it doesn’t/shouldn’t matter how it’s actually implemented
- This idea is often referred “data abstraction” - we separate how
we use the data from how we represent them.
- Implication: When we’re dealing with a collection of data, we should
think about how to abstract away our own representations, using only
the procedures we design.
- Side note: Often, we’ll be called upon to implement someone else’s
not-necessarily clear policies.
- Father John Doe gets filed under
- “F” for “Father”. Blah blah blah Religious Titles.
- “D” for “Doe”. Look at the Sister example.
Questions
Administrative
Readings
Is it possible to change the mutability of structs like you can
with vectors or hash tables?
Yes, we can make mutable structs. By default, structs are immutable,
but you can add #:mutable
to either the struct as a whole or
individual fields to make them mutable. Check out the Racket Guide
on Structs
for details.
How do we know what we can put in a structure? (i.e. year, month, date)
Documentation! (or you could read the code)
Can you explain what the difference between a husk and a kernel is?
You’ve noted we often have implicit restrictions on our procedures
(e.g., input types, limits on input values). Ideally, we should
“fail clearly” on bad inputs. But that means taking the effort to
check for bad inputs. The husk protects the kernel by checking
inputs; the kernel does the main work and assumes that it has
correctly inputs.
Could you give a broad overview of why this reading is important?
We learned on Monday that it’s good to separate what we do with
data from how we represent it. Structs give us a programmatic way
to do so.
Also: Structs automatically build a bunch of procedures for you.
Where do date-kernel-year
, date-kernel-month
, and date-kernel-day
come from?
They are generated automatically from
(struct date-kernel (year month day))
.
We also get the date-kernel
constructor and the date-kernel?
predicate.
What are the paremeters to date-kernel?
?
Any one value. The predicate returns true if it was created with
date-kernel
(either directly or indirectly) and false otherwise.
Lab