Created
November 7, 2016 18:57
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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