I am trying to solve riddle similar to the Einstein's riddle. To solve this I am using library for making permutations
First I define all permutations over subjects
(def auta (permutations [:Opel :Jeep :Renault :Octavia :Peaguot]))
(def skym (permutations [:pes :rodina :kamaradka :pratele :sam]))
(def mena (permutations [:Honza :Viktor :Marek :Ota :pavel]))
(def prace (permutations [:Student :Malir :Technik :Prog :nic]))
(def typ (permutations [:Wherti :Myst :Multi :trad :earth]))
Next I make the list of matrix of solutions
(def all (for
[a (doall auta) s (doall skym) m (doall mena) p (doall prace) t(doall typ)]
[a s m p t]))
This working as I want and I can print first item
(print (take 1 all))
This will show me:
([(:Opel :Jeep :Renault :Octavia :Peaguot) (:pes :rodina :kamaradka :pratele :sa
m) (:Honza :Viktor :Marek :Ota :pavel) (:Student :Malir :Technik :Prog :nic) (:W
herti :Myst :Multi :trad :earth)])nil
Now I want to add a conditions in for (at first I want to add condition that the :pavel is first name of permutation.
(def all (for
[a (doall auta) s (doall skym) m (doall mena) p (doall prace) t(doall typ)
:when (= (m 1) :pavel) ]
[a s m p t]))
and I end with
CompilerException java.lang.ClassCastException: clojure.lang.LazySeq cannot be c
ast to clojure.lang.IFn, compiling:(C:\Users...
What I need t change in condition to make it running?
P.S.: I try to do thing like (doall m) etc. but it did not help.