-2

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


SwordW
  • 592
  • 2
  • 6
  • 20
  • The code is missing? – schaueho Feb 07 '16 at 12:07
  • why have you removed the code in the edit? given that it might have been alot more than needed for the problem, the question as it stands right now is confusing, since the text still refers to "this is the code" - what code? – cfrick Feb 07 '16 at 12:08
  • I was trying to delete the whole question because the only thing I get is the useless answer below. but someone support the answer so I can't. I changed my code a lot so I do not need to ask the question now. so I delete the code – SwordW Feb 07 '16 at 17:15

1 Answers1

2

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.

Timothy Pratley
  • 10,586
  • 3
  • 34
  • 63