Open up repl, and type
(interpose "|" ["A" "B"] )
This should work fine - yielding a bar separated list.
Now, add an extra set of parenthesis --- and things get really ugly.
?>((interpose "|" ["A" "B"] ))
java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0)
What happened ? Silly rabbit : don't you know that Clojure is LISP and it is FUNCTIONAL ? In other words.... it saw your parentheses - which would normally [at the repl] comprise a function definition - [well, really, that is if unqouted - but thats for another day].
?>((interpose "|" ["A" "B"] ))
java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0)
What happened ? Silly rabbit : don't you know that Clojure is LISP and it is FUNCTIONAL ? In other words.... it saw your parentheses - which would normally [at the repl] comprise a function definition - [well, really, that is if unqouted - but thats for another day].
This seems trivial , like one of those errors you can glance over. Its not. You have to know how important parenthesis are in Clojure, or you'll never "get it".....
python training in bangalore
ReplyDeleteaws training in bangalore
artificial intelligence training in bangalore
data science training in bangalore
machine learning training in bangalore
hadoop training in bangalore
devops training in bangalore