When you write higher-order functions in Clojurescript, it is actually possible to omit parameters for a passed-in function.
For instance, the following is legal Clojurescript code but illegal Clojure code:
(def x (atom 5))
(swap! x (fn [] 6))
The higher-order "swap!" function expects a function that takes one parameter, but you can omit it and the program will still compile/run 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 a Clojurescript limitation? Any opinions?
Thanks for your thoughts!
reset!instead ofswap!. It does what you want. - levand