Home Ask Login Register

Developers Planet

Your answer is one click away!

SwordW February 2016

Don't know how to create ISeq from: clojure.lang.Var error

This is the code I write for ant looking for food genetic program. This is the first day I try to learn clojure, clojush, push. When I try to run this code, I get

CompilerException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Var

I have no idea what happens.

Also, if you see something else is wrong, or maybe my whole idea is wrong, please let me know also. Thanks


Answers


Timothy Pratley February 2016

doall expects a collection as an argument.

Don't def inside functions. Def creates a global var. You should avoid side-effects inside a function. State should be managed using atoms, refs or agents.

I recommend you start with smaller pieces. Try getting one function working at at time. You will progress faster and if you need to ask for help, it will be clearer what you are stuck on. Also look at the full stack trace, it will tell you where exactly the problem is occurring.

Post Status

Asked in February 2016
Viewed 1,173 times
Voted 4
Answered 1 times

Search




Leave an answer


Quote of the day: live life