Functional Problem Solving (CSC 151 2015F) : Reference
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)]
(if
test
consequent
alternative
)
test
. If its value is truish (that is,
anything but false), evaluate consequent
and return its value. If the value of test is false (#f), evaluate
and return alternative
.
(when
test
exp_{1}
exp_{2}
...
exp_{n}
)
test
. If it holds, evaluate
each expression in turn. Otherwise, do nothing.
(cond
(test_{1}
consequents_{1}
)
(test_{2}
consequents_{2}
)
...
(test_{n}
consequents_{n}
)
(else
alternative
))
(and
exp_{1}
exp_{2}
...
exp_{n}
)
(or
exp_{1}
exp_{2}
...
exp_{n}
)