Appendix
About
This section is included to assist the students to perform the activities present in the book. It includes detailed steps that are to be performed by the students to complete and achieve the objectives of the book.
1. Hello REPL!
Activity 1.01: Performing Basic Operations
Solution:
- Open the REPL.
- Print the message "I am not afraid of parentheses" to motivate yourself:
user=> (println "I am not afraid of parentheses")
I am not afraid of parentheses
nil
- Add 1, 2, and 3 and multiply the result by 10 minus 3, which corresponds to the following infix notation: (1 + 2 + 3) * (10 - 3):
user=> (* (+ 1 2 3) (- 10 3))
42
- Print the message "Well done!" to congratulate yourself:
user=> (println "Well done!")
Well done!
Nil
- Exit the REPL by pressing ...
Get The Clojure Workshop now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.