n = (count somevector)
(foo [w] ( for [i (range n)
j (range w)
:let [n (* i j)]
:while ( < i j)
]
(println n)))
When i run it.
=> (foo 10)
ClassCastException clojure.lang.LazySeq cannot be cast to clojure.lang.IFn HelloWorld.core/foo
What I am really looking to do is have a couple of nested for loops and have some ifs and else inside it do some checking.
Edit ::
As it turns out the following also causes error
(defn foo [arg]
(
for [ i (range (count vector)) ]
(
for [j arg ]
[i j]
)
) )
IllegalArgumentException Don't know how to create ISeq from: java.lang.Long clojure.lang.RT.seqFrom
Edit::
the following works
(defn foo [arg]
(def w arg)
(for [ i (range (count vector)) ]
(
for [j (range v) ]
[i j]
)
) )
Now can someone help me understand why would it not work in the first place ?