;; Clojure has NO operator overloading. + - = < are ordinary
;; functions and none of them can be taught a new type.
;; A unary operator therefore becomes a plain named function.
(defrecord Point [x y])
(defn p-inc [p] (->Point (inc (:x p)) (inc (:y p))))
(defn p-neg [p] (->Point (- (:x p)) (- (:y p))))
(def p1 (p-inc (->Point 1 1)))
;; p1 is 2, 2
(def p2 (p-inc p1))
;; p2 is 3, 3
(def p3 (p-neg p2))
;; p3 is -3, -3
(println "p1 is" (:x p1) (:y p1))
(println "p2 is" (:x p2) (:y p2))
(println "p3 is" (:x p3) (:y p3))