Ideally in functional programming everything is a (pure) function (and this is how I program), so you never have your variables defined.
Instead, my standard setup is to debug a function by saving its arguments in a vector, e.g.
(defn buggy-function [a b c]
(def test-bf [a b c]) ;; <- add this
... function body ...
)
Then I can call buggy-function with (apply buggy-function test-bf)
and modify the code until it behaves as expected.This is also where immutability has its grand appearance.