Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vigilancetech-com/97e8726f2be8e18c575334c414d44fd3 to your computer and use it in GitHub Desktop.
Save vigilancetech-com/97e8726f2be8e18c575334c414d44fd3 to your computer and use it in GitHub Desktop.
can't call a clojure function that was originally stored in a list
boot.user=> (def a #(println "I'm a function"))
#'boot.user/a
boot.user=> (a)
I'm a function
nil
boot.user=> (def b '("some text" #(println "another function")))
#'boot.user/b
boot.user=> (first (rest b))
(fn* [] (println "another function"))
boot.user=> ((first (rest b)))
java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IFn
boot.user=> (#(first (rest b)))
(fn* [] (println "another function"))
boot.user=> ((#(first (rest b))))
java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IFn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment