Slide 4
Slide 4 text
Javier Gonzalez-Sanchez | CSE240 | Spring 2018 | 4
jgs
Control Structures
§ if only allows one test-expression, one then-expression, and one optional-
else-expression.
§ To do more things in the then-expression we need to make a block. Blocks
are made with the special form progn, which takes the form:
(progn expr1 expr2 expr3 ...)
• (if (> 3 2)
(progn (print "hello")
(print "yo")
(print "whassup?")
(+ 2 2))
(+ 1 2 3))
"hello"
"yo"
"whatsup?"
4