When you write higher-order functions in Clojurescript, you can actually omit the parameters for the passed function.
For example, the following legitimate Clojurescript code, but illegal Clojure code:
(def x (atom 5))
(swap! x (fn [] 6))
Higher Swap! the function expects a function that takes one parameter, but you can omit it, and the program will still compile / execute just fine.
Would it be considered bad form to use this ability if it makes my Clojurescript code cleaner? Or is it just abuse of Clojurescript restrictions? Any opinions?
Thanks for your thoughts!
source share