chapter ten
Lesson 10. Capstone project: Know your REPL
10.1 Mission
Your mission is to run as many Clojure expressions as you can in the Klipse REPL.
- Install Clojure your machine
- Evaluate at least 2 flat expressions and 2 nested expressions in the default Clojure REPL
- Install the Klipse REPL on your machine
- Evaluate at least 5 flat expressions and 5 nested expressions in the Klipse REPL
The forms that we have learned so far:
- arithmetic expressions: +, *, - and /
- arithmetic comparisons: >, <, >=, <= and =
- logic operations: and, or and not
You can either write your own expressions combining the forms that we have learned so far or pick one of those:
Flat expressions:
(+ 2 3 4 5) (* 1 2 1 8) (/ 2 4 3) (- 3 5 9 8) (and true false 3) (not 4) (or true false 3) (= 2 3 4) (< 1 4 5)
Nested expressions:
(* (+ 2 3) (+ 4 5))
(+ (* 11 2) (* 2 8))
(/ (+ 2 4) 3)
(- (* 3 5) (+ 9 8))
(+ (* 4 3) (+ 7 8) 11)
(or
(and (< 2 2)
(zero? 2))
(not (= 6 4)))
(or
(and (not (> 3 2))
(not (neg? 2)))
(not (= (+ 6 2) 4)))
(and
(or (= 2 3)
(> 4 5))
(= 4 5)
(not (> 2 3)))
(and
(or (= 2 3)
(> 4 5))
(and (> 3 9)
(= 4 5))
(not (= (+ 2 2) 3)))