Functional Problem Solving (CSC 151 2015F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Taking Notes] [Rubric] [Remote Access]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Labs] [Outlines] [Readings] - [Examples] [Handouts]
Reference: [Setup] [VM] [Errors] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Curtsinger (2015F)] [Davis (2013F)] [Rebelsky (2015S)] [Weinman (2014F)]
Misc: [Submit Questions] - [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)]
Overview
When I run my procedure, instead of seeing a result, I see something
like <procedure:hop.sadasfasffsdad#1231321>
(define my-proc
(lambda (a b c)
(o (section max a <>) (section max b <>) (section max c <>))))
> (my-proc 1 2 3)
#<procedure:...gigls/higher.rkt:215:4>
This means that you've written a procedure that returns a procedure. Congratulations! Many (non-Grinnell) CS majors don't learn how to do this until their senior year. But that's probably not what you wanted. Send me your code and I'll help you figure it out.
How many tests should we have in problem 4?
Enough that you are confident that a procedure written by any well-intentioned but incompetent programmer that passes your tests will always be correct. Probably about eight or so different cases in which you look at the minutes and seconds of each.
* EG says: Don't only write similar tests like "1 min 3 sec plus 2 min 3 sec" "2 min 3 sec plus 3 min 4 sec".)
Should we try times that go over an hour?
Yes, that would be good. But they will give large numbers of minutes; you should not worry about dealing with hours.
I got `Contract violation! Expect a lawyer to appear soon. Expected number?. Got procedure!
(+ + -) will give you that error, as will any attempt to use a procedure when Scheme expects a number.
Do you need a picture for the last problem?
No. The kitten has suffered enough.