Warning! You are being recorded and transcribed, provided the technology is working correctly.
Approximate optimistic overview
These are all after break.
Scholarly
Artistic
Multicultural
Peer
Musical, theatric, sporting, and academic events involving this section’s students are welcome.
Wellness
Misc
These do not earn tokens, but are worth your consideration.
I seem to have missed a fair number of labs. Can I make them up over break?
My usual policy is “No”. But the world is chaotic, so I’m being a bit more open. You may make up missed labs over break. Teams Message or Email me when you’ve finished each one and I’ll open up a late submission on Gradescope.
I seem to have missed a fair number of reading responses. Can I make them up over break?
See the previous answer.
I seem to have missed a fair number of post-reflections. Can I make them up over break?
See the previous answer (or perhaps the previous previous answer).
I seem to have missed a fair number of pre-reflections. Can I make them up over break?
No.
Will you post more redos for over break?
Yes. Second redos for MPs 1, 2, and 3 are due the Sunday after break.
First redos for MPs 4 and 5 are also due that Sunday.
If I make up a lab, can I stop after ??? minutes and submit whatever I’ve completed.
Yes. ??? minutes is 60 minutes.
My quiz is missing. What’s up with that?
I’ll look during lab.
When will we know how many tokens we’ve used and earned?
You should know. But I’ll be counting during the first week of break.
What is the benefit to using let
to define a local helper procedure
as opposed to defining it outside the main procedure?
The helper procedure may want to use the parameters to the enclosing procedure. This way, we don’t have to pass all of those parameters to the helper.
E.g.,
(define rectangle
(lambda (left top width height rcolor bg iwidth iheight)
(let ([helper (lambda (x y)
(cond
[(some-test x y width height)
rcolor]
[...]
[else
bg]))])
(image-compute helper iwidth iheight))))
We can worry less about name overlaps. For example, instead of
stack-and-sequence-helper
, we could just usehelper
.
Why bother naming our helper procedures instead of using anonymous procedures?
Perhaps it avoids repetition. Perhaps it clarifies our code.
It says that a let
expression may have multiple bodies. If the let
expression only takes the value of the last body, then why would a
programmer use multiple bodies in a let
expression?
There are some procedures we call for their “side effects”; they change the state of the system. We haven’t encountered any such procedures yet, but we will.
Can we please go over check 3, ratios revisited?
Certainly.
;;; (v2c-ratio str) -> rational?
;;; str : string
;;; Determine the ratio of vowels to consonants in str
(define v2c-ratio
(lambda (str)
(/ (tally vowel? (string->list str))
(tally consonant? (string->list str)))))
Idea one:
(define v2c-ratio
(lambda (str)
(let ([num-vowels (tally vowel? (string->list str))]
[num-consonants (tally consonant? (string->list str))])
(/ num-vowels num-consonants))))
Benefit: Potentialy more readable. But doesn’t solve the problem of
calling string->list
twice.
(define v2c-ratio
(lambda (str)
(let ([chars (string->list str)])
(let ([num-vowels (tally vowel? chars)]
[num-consonants (tally consonant? chars)])
(/ num-vowels num-consonants)))))
Benefit: Only convert the list to a string once.
Here’s a less good approach.
(define v2c-ratio
(lambda (str)
(let ([count-chars (lambda (pred?)
(tally pred? (string->list str)))])
(/ (count-chars vowel?)
(count-chars consonant?)))))
If it works, it’s a bit harder to read. But we’re still doing
string->list
twice. So this neither clarifies (except for Sam)
nor speeds things up.