anybody got simple debug macros? like one that prints a form and its value? something more fun than raw js/console.log
(defmacro inspect [form]
(list 'js/console.log (list 'quote (pr-str form)) :-> form))This has evolved to
(defmacro i [form]
`(let [~'result ~form]
(js/console.log ~(pr-str form) :-> ~'result)
~'result))
used like (um/i (identity {:tag "good-one"}))yeah :)
it's already a big improvement over raw javascript
gotcha
nice! Thank you.
btw it's better to let- bind the form so it will only be evaluated once, then print it and then return the result, but you can probably figure this out