Im getting scary * cannot be passed to IFn error with a simple math function here:
(defn calc [sc1 m1 alpha beta gamma ta1 tb1 min_m1 min_tca tca_ratio x32] (* (max(0, (+ (* alpha log(sc1)) (* beta log(m1)) (* gamma (/ ta1 tb1)) (- log(ta1) log(tb1))))) (max(x32,(/ m1 min_m1))) (max(x32,(/ tca_ratio min_tca)))))
;;;;;;;;;;;;;;;;
Arguments are just a bunch of numbers:
(calc 1 2 3 4 5 1 2 3 4 5 1)
My thoughts / My question
Usually, when I get this error, I find that this is due to
1) An extra parenthesis (i.e. when I accidentally added an extra closure to my code) OR
2) Arguments that are incorrectly ordered (obviously, an exception to the list).
My question is simple ... how to fix this fragment and, possibly, how can I defeat this general exception once and for all? It seems like this happens quite often on my Clojure expeditions, and I think maybe I don't have the right development style yet.
-------------------------------------------- ------ -----
UPDATE:
I encoded my code with irregular syntax. Errors were in internal functions that used java / c style function calls: for example, max / log ...
source share