Consider the two definitions:
(defn if-let-good [str]
(if-let [rest (seq (drop-while (partial = \a) str))]
(first rest)
"empty"))
(defn if-let-bad [seq]
(if-let [rest (seq (drop-while (partial = \a) seq))]
(first rest)
"empty"))
The only difference between them is the name of the arg: "str" in the
good
definition, "seq" in the bad definition.
(if-let-good "")
=> "empty"
(if-let-bad "")
aborts with:
java.lang.String cannot be cast to clojure.lang.IFn
[Thrown class java.lang.ClassCastException]
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en