title: Clojure : java.lang.Character cannot be cast to clojure.lang.IFn
body: <p>I just wanted to write a simple little guessing game in Clojure, and I got this error. I can't see where is a Character treated like a function in my, as the resulted input also predicts that there should not be such problem. Here's the code: </p>
  
  <pre><code>(ns clojure.examples.hello
    (:gen-class))
  
  (ns clojure-noob.core)
  
  (defn takeFst [x n]
      (if (= n 0) () (cons (first x) (takeFst (rest x) (- n 1))))
  )
  
  (defn createSeq [elem n]
      (if (= n 0) () (cons elem (createSeq elem (- n 1))))
  )
  
  (defn fnEquals? [n]
      (fn [elem] (= elem n))
  )
  
  (defn removeEach [x elem]
      (remove (fnEquals? elem) x)
  )
  
  (defn containsString? [s ch]
      (not (empty? (filter true? (map = (createSeq ch (count s)) s))))
  )
  
  (defn akasztofa! [s lives]
      (println s)
      (if (and (not= () s) (not= lives 0))
          (
              (def guess (eval (read)))
              (if (containsString? s guess) (akasztofa! (removeEach s guess) lives) (akasztofa! s (- lives 1)))
          )
          ()
      )
  )
  
  (akasztofa! "hab" 10)
  </code></pre>
  
  <p>The output I get is this: </p>
  
  <pre><code>hab
  (a b)
  (b)
  () 
  Exception in thread "main" java.lang.ClassCastException: 
  java.lang.Character cannot be cast to clojure.lang.IFn, compiling:
  (/home/cicaharcos/Documents/Clojure/First/akasztofa/main.clj:38:1)
  </code></pre>
  
  <p>My input was: \h \a \b</p>