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.
Is there a keyboard shortcut for commenting?
I’m not sure. You’ll hear me say that a lot. Deal.
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.
Starting view: “Put bread on plate; spread peanut-butter on bread; cut up banana onto peanut butter; eat.”
Whoops. We need to explain concepts. “To spread peanut butter on bread, first open the peanut butter, then remove some and place on the bread. THen grab a knive (by the handle please, not in the slasher orientation). MOve the blade of the knife on the peanut butter.”
Too many years of software development suggests that this is a good way to think about design..
Can we go over the specific parts of a procedures?
Certainly.
There are three main parts to a procedure (subroutine, function, method).
- The name of the procedure; how we refer to it.
- The inputs to the procedure; how we refer to them. (In some programming languages (not Scheme), we also give an explicit “type” to the inputs - this is a number, this is a string, this is an image.)
- The instructions for the procedure (code), often call that the body.
In Scheme (or at least our policy on Scheme), we write procedures with
(define NAME
(lambda (INPUTS)
BODY))
(define grid
(lambda (image)
(above (beside image image)
(beside image image))))
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.
Make sure that you’re doing the lab called “procedures”. You may have to refresh your schedule.
Make sure to save! (procedures.rkt
)