by Groxx · 6y ago · 0 comments
//if (some logic) {
do something
//} else {
// something else
//}
Or in other cases collapse two if/else blocks together, or stuff like that. It's not as common as commenting out a logical unit, definitely, but it's far from uncommon.How would you achieve that in Clojure? Seems like you'd need to copy/paste, like this?
#_(if (cond) thing other_thing)
thing ;(if (cond)
thing
; other)
If yes: great! The best of both worlds. (if (test) (then) (else))
(if true #_(test) (then) (else))
(if false #_(test) (then) (else))
makes it quite simple to leave the tests in. Also, quite easy to raise forms (structurally raise) and reevaluate the form and then undo but not reevaluate the form to have it modified.