Functional Problem Solving (CSC 151 2016S) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Taking Notes] [Rubric]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Labs] [Outlines] [Readings] - [Examples] [Handouts]
Reference: [Setup] [Remote] [VM] [Errors] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Curtsinger (2016S)] [Davis (2013F)] [Rebelsky (2015F)] [Weinman (2014F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)]
Overview
Can you clarify the difference between test-case and test-suite.
Both groups tests/checks together.
test-suites are delayed; only run when you say
run-teststest-cases, unless nested in test-suites, run immediately
Irrelevant for today's quiz
Is cond just like if but with extra brackets?
conddoes more tests!
> (define classify
(lambda (number)
(if (< number 60)
'f
(if (< number 70)
'd
(if (< number 80)
'c
'b)))))
> (classify 85)
'b
> (define classify
(lambda (number)
(cond
[(< number 60)
'f]
[(< number 70)
'd]
[(< number 80)
'c]
[else
'impossible])))
Why do I get #f for (and (= 2 3) (/ 3 0)) but an error if I write
(and (= 2 2) (/ 3 0)).
andevaluates each expression in turn. If the expression is false,andreturns immediately. Otherwise,andmoves on to the next expression. If any of the expressions it hits gives an error,andgives an error.
No writeup today!