(use fugue)
(import /src/calc)
(defgeneric p
[val] (describe val))
(defmethod p calc/Int
[n] (string (n :value)))
(defmethod p calc/Float
[n] (string (n :value)))
(defmethod p calc/Operation
[o] (string (o :type)))
(defmethod p calc/Adverb
[a] (string (a :type)))
(defmethod p calc/Vector
[v]
(let [inner (map p (v :data))]
(string "[" (string/join inner " ") "]")))