I'd love to use all this but the fact that you have to substitute in variables just makes this very not-useful.<p>Ideally in functional programming everything is a (pure) function (and this is how I program), so you never have your variables defined.<p>Instead, my standard setup is to debug a function by saving its arguments in a vector, e.g.<p><pre><code> (defn buggy-function [a b c]
(def test-bf [a b c]) ;; <- add this
... function body ...
)
</code></pre>
Then I can call buggy-function with<p><pre><code> (apply buggy-function test-bf)
</code></pre>
and modify the code until it behaves as expected.<p>This is also where immutability has its grand appearance.
> Note that def we have inserted, to define a global variable request. This is a powerful debug mechanism, but a better way to use it is a tool like [snitch](<a href="https://github.com/AbhinavOmprakash/snitch">https://github.com/AbhinavOmprakash/snitch</a>).<p>Wow, wish I knew about snitch earlier!
I have been using a similar, much less powerful, set of macros for this: <a href="https://gist.github.com/mjdiloreto/9e7c65023fff691b5ab7d297d9b97502" rel="nofollow">https://gist.github.com/mjdiloreto/9e7c65023fff691b5ab7d297d...</a><p>In my experience, this is a phenomenal way to develop.
You just replace whatever `defn` or `let` you are working on with `defn<i>` and `let</i>`, and interact with your app normally (click around in the UI, trigger the frontend or backend functions you are examining). Combined with a tool like portal (<a href="https://github.com/djblue/portal">https://github.com/djblue/portal</a>) you can quickly get an overview of your system <i>while it is running</i>!