(defmacro my-println [x]
`(do (printf "%s:%s> %s is %s\n"
~*file*
~(:line (meta &form))
~(pr-str x)
~x)
(flush)))
Looking at this answer again much later, you can be a little smarter if you like, reducing the cost of runtime by interpolating string constants at compile time:
(defmacro my-println [x]
`(println ~(format "%s:%s> %s is"
*file*
(:line (meta &form))
(pr-str x))
~x))
, printf :
(let [x 5] (macroexpand '(my-println (+ x 5))))
(clojure.core/println "foo.clj:1> (+ x 5) is" (+ x 5))