vendredi 25 janvier 2019

Clojure - If based on Some result

I want to start this post with an apology, I am entirely self tought and this is my first question, though I use Stackoverflow A LOT.

I want to make a decision based on the result of a Some function...

  (if (= nil (some (partial = (:activeboard (:boards app)))(:otherboards (:boards app))))
  (om/transact! (:boards app) :activeboard (fn [_] active)))

I know the Some test works as I have the same Some function further down to output the result to the screen. But the If test does not. I have similarly tried a case and a condp. nothing seems to evaluate the Some function. The result of the Some function is either nil, or true, so If should evaluate that??

Aucun commentaire:

Enregistrer un commentaire