4 (require '[clj-time.core :as t])
5 (require '[clj-time.format :as f])
8 (defrecord Product [id name available price])
10 ;; Positional constructor
11 (def product1 (->Product "1" "T-Shirt 1" true 15.00))
14 (def product2 (map->Product
21 (def product3 {:id "1"
32 (def categories #{"shirts" "shoes" "belts"})
38 (defn factorial [value] (cond
40 :else (* value (factorial (- value 1)))))
42 (def basic-formatter (f/formatter "YYYY-MM-dd hh:mm:ss"))
43 (defn now [] (f/unparse basic-formatter (t/now)))
45 ([] (println (now) "No message"))
46 ([message] (println (now) message)))
50 (println (:id product1))
51 (println (:name product2))
52 (println (:name (get (:sellers product3) 0)))
53 (println (first categories))
55 (println (factorial 5))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list