Approximate overview
Note: You do not get credit if others are supporting you (e.g., if you’re playing at a tennis meet or hosting Lunar New Year). You also don’t get credit for evening tutors.
What’s wrong with the following? (TPS)
(define mentor->section
(lambda (mentor)
(cond
[(string=? mentor (or "Cassandra" "Quang"))
"Section 01"]
[(string=? mentor (or "Hallie" "Nameera"))
"Section 02"]
[(string=? mentor (or "Micah" "Paul"))
"Section 03"]
[else
"Not a mentor"])))
string-ci=? to do case-insensitive matching.ors look kinda weird.or should return #t or #f, not a string.
(mentor->section "Cassandra") works.(mentor->section "Quang") doesnt’ work.(or "Cassandra" "Quang") is "Cassandra".'(+ 2 3) looks a lot like (+ 2 3).'stuff is short for (quote stuff).'('stuff 'more stuff) is short for
(quote ((quote stuff) (quote more) stuff))(map list? '((a b) (c d) e))(map list? (quote ((quote stuff) (quote more) stuff)))(map list? '('stuff 'more stuff))apply vs reduce vs map(THING proc lst).reduce is designed for two-parameter procedures. It combines
pairs repeatedly until it has a single value.apply works better for procedures that take an arbitrary number of
parameters. It applies the procedure en masse.map needs to match the number of lists. If there
is only one list, it needs to be a one-parameter procedure. It
applies the procedure to each element separately, creating a new list.reduce does not behave predictably in terms of which
pairs it combines. Hence, the procedure you use with it should work
the same no matter what order things are combined.reduce-left or reduce-right, but you give up
the opportunity for parallelization.What does “match” mean in the regular expression context?
We have a pattern given by the regular expression. We use “match” to mean “corresponds to the pattern” (or vice versa).
What do you mean when you say Kleene was your great grand advisor?
When you do a Ph.D., you have an academic advisor who guides you through the Ph.D. O’Donnell was my advisor. Constable was O’Donnell’s advisor (and therefore my grand-advisor). Kleene was Constable’s advisor (and my great grand advisor). (I use grandparent-like terminology here.) Church was Kleene’s advisor. Church invented “lambda” as a way of writing procedures.
I have an eight-hour lab tomorrow. Can I have an extension on the SoLA?
Yes. DM me to let me know.
(char-alphabetic? char) determines whether or not char is a letter.(length lst) tells you how many values are in a list(tally-value lst val) tells you how many times val appears in lst.(tally pred? lst) tells you how many things in the list meet the
predicate.