Approximate overview
Academic
Cultural
Peer
Wellness
Misc
(round 4.4)(round 4.6)(round 4.5)(round 5.4)(round 5.6)(round 5.5)Observation: In the case that we are halfway between two integers, it rounds to the even integer. Why? Because that’s what statisticians like to do.
A reminder that it can be interesting (or confusing) (or frustring) (or all of the above) to experiment with the new procedures you learn.
The way you organize code affects how readable it is.
Thewayyouorganizecodeaffectshowreadableitis.
Thew
ay youorganize
your c o d e a
ffects how
r
e
a
d
a
b
l
e
it
is
.
Try to follow the basic patterns we are using. Some of the more important principles follow.
Move on to new lines (a) in “standard” places—e.g., before the
(lambda—and (b) when lines are getting too long.
Make sure to hit Ctrl-I before submitting (or regularly). This command reindents your code according to standard principles. (However, it does not insert new lines.) (Ctrl-I is very useful for finding mismatched parentheses.)
End parentheses belong at the end of the last line of code, not on a line by themselves.
No nested defines. (No putting define in the middle of your procedure.)
(This is a Grinnell stylism.)
Try to put comments before defines, not after and not to the side.
Ask questions. It’s part of self gov. If you have questions, others likely do, too.
If we didn’t meet stylistic guidelines, should we update our code and resubmit?
Only if you want an M or above on this mini-project.
Does this mean we get a free extensions?
Yes. You get an extension without using tokens.
What do we do if the autograder won’t work with our code?
Ask an evening tutor.
TeamsChat Sam. (Usually only works until 9pm).
TeamsChat or Email Sam and hope he’ll answer the next day (after 9pm).
In this case, most of the problems seemed to be that the code referenced
kitten.jpgbut did not includekitten.jpg.
What did you mean about “no nested defines”?
Some people write
(define foo
(lambda (x)
(define bar (* x x))
(rgb bar bar bar)))
So how do we get rid of redundant code?
Use a helper procedure.
(define foo
(lambda (x)
(foo-helper (* x x))))
(define foo-helper
(lambda (bar)
(rgb bar bar bar)))
Is there a rule about indenting?
Use whatever Ctrl-I does.
Are there formatting guidelines for documentation?
Follow the models.
Read the reading for Monday.
Three semicolons, a space, the “signature” of the procedure (open paren, procedure name, the parameters separated by spaces, a close paren), an arrow, and a type predicate or something similar.
Three semicolons, three spaces, the name of the first parameter, a space, a colon, a space, a type predicate or something similar.
(Repeat for remaining parameters)
Three semicolons, a space, and a sentence or two on what the procedure does.
Can I make other changes (beyond formatting and academic honesty)?
Certainly.
Are you ever going to stop talking Sam?
Maybe.
Can I send questions to the mentors outside of class time? How about asking them questions if I see them working in 3813?
They have their own work to do. Stick with the evening tutors.
Mentor sessions are good.
Do you expect us to finish lab today?
As far as you get is fine.
Continue from last class.
Scheme style
Cond vs if
Some fun with numbers