In this recipe, we will review primitive data types that Clojure supports and a few functions that manipulate these types. Here, we will review the following:
You only need REPL, as described in the previous recipe, and no additional libraries. Start REPL so that you can review the sample code of primitive types immediately in this recipe.
Let's start with numbers in Clojure data types.
+ function returns the sum of numbers. You can specify any number of numbers as arguments:
(+ 1 2) ;;=> 3 (+ 1 2 3) ;;=> 6 (+ 1.2 3.5) ;;=> 4.7
- function subtracts the numbers. If a single argument ...