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.
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 if I had special exceptions?
Remind me of them if/when I charge you tokens.
I know that reports on token events are due within 3 days. Can that be 3 months instead?
Sure.
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)))))
Let’s make it better using let
.
(define v2c-ratio
(lambda (str)
(let ([chars (string->list str)])
(/ (tally vowel? chars)
(tally consonant? chars)))))
lst
more times, it’s easy to do so.string->list
, we’re only doing one.(define v2c-ratio
(lambda (str)
(let ([count (lambda (pred?)
(tally pred? (string->list str)))])
(/ (count vowel?)
(count consonant?)))))
str
to a list twice. That’s inefficient
as compared to the second version (but not the first).Combining the strategies.
(define v2c-ratio
(lambda (str)
(let ([chars (string->list str)])
(let ([count (lambda (pred?)
(tally pred? chars))])
(/ (count vowel?)
(count consonant?)))))