Warning! You are being recorded (and transcribed) (provided the technology is working correctly).
Today’s start-of-class procedure
Note: If you need to sit in a particular area of the classroom, let me know and we’ll work things out in the future.
Approximate overview
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.
Why do some of my assignments say “Submitted” and some say “Ungraded”?
“Submitted” means that you’ve submitted it but I haven’t started grading the assignment.
“Ungraded” means that you’ve submitted it, and I’ve started grading the assignment, but I haven’t gotten to yours yet.
Note that “I” can also mean “the graders”.
Though I have written my own code, I have used a library created by Grinnell CS. Is it necessary to cite in this case, and if so, how do I properly cite the section of the csc151 library that I used?
If you are importing a library (in our case, with
(require csc151)
), you need not provide additional citations.
How do we go back and edit code?
I assume you’re asking about the interactions pane. On Linux and Windows boxes, it’s usually Ctrl-UpArrow and Ctrl-DownArrow. On the Mac, it’s Esc-P (previous) and Esc-N (next).
Why won’t DrRacket load the csc151 library on my computer?
I’m not sure. Chat with me individually.
Can I just run a few lines of the code in the definitions pane?
Not usually. The assumption is that we’ll run all of the lines.
Can DrRacket’s image model use hexadecimal color?
If you mean the hex for RGB, then yes. You need to use something like
(hex->rgb "AA00B7")
.
Why does the name of the color have to be in quotation marks, and how does DrRacket know that its a color not a string?
Actually, it’s a string that names a color. If it weren’t in quotation marks, DrRacket would think that it’s something we’ve named with
define
.
I don’t really understand the top-down design, particularly what the purpose of using ??? just to come back and replace it is.
We’ll think about this in terms of the PB&J sandwich.
Big picture: Get bread, add peanut butter, add jelly, eat.
But we may need to explain more.
To get bread, you need to open the bag, pull out the top two pieces of bread, put them on the plate side by side face up.
Can we go over the specific parts of a procedures
Certainly.
There are three main important things for most procedures (subroutines, functions):
- The name of the procedure (how we’ll refer to it)
- The names of the inputs to the procedure (also the types, but Scheme doesn’t require those).
- The actions the procedure is supposed to do. (The “body”)
In Scheme/Racket, we put all of this together with
(define PROCEDURE
(lambda (INPUTS)
BODY))
For example,
(define boxed-circle
(lambda (box-size box-color circle-color)
(overlay (solid-circle box-size circle-color)
(solid-square box-size box-color))))
Can you define local named things within a procedure?
Yes, there’s a way to do so. We will not teach you it yet.
I know the text mentioned we will cover lambda without define eventually but I would genuinely love to know why the idea of it being “anonymous” is so powerful.
We should talk about it next week. (Perhaps even this week.) It’s more than just the lambda.
For the check 2 in the last reading, when I wrote the code (solid-rectangle 40 20 "color")
, it did not work. Why are we not supposed to use “” with color?
The quotation marks mean “Take it verbatim” rather than “treat this as an input to the method”. There’s no color named “color”, so it gives an error.
How do we keep things grouped together for a layer?
Usually with a
define
of the compound thing.
Can you explain more about the parts of the rubric?
I’d prefer to focus on individual parts. Ask on Teams.
Make sure that you’re doing the lab called “procedures”. You may have to refresh your schedule.
procedures.rkt
.