by king_magic · 11y ago · 0 comments
(defn debug-it
[x]
(println x)
x)
(-> input-value
debug-it
function1
debug-it
function2
debug-it
function3
debug-it)
Debug-it could also take a custom message at each line if you wanted the output tagged with names/numbers.In the toy function given, it doesn't really matter, but in general, I think that people should aim to code for clarity, not ease of debugging.
I do think it's a smell if the expressions has side effects, but that's a different issue.