Fork me on GitHub

Hi all - I’ve been playing with strings in a babashka REPL and ran into a `java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn` error. Can anyone help me understand what I’m doing wrong here? Here’s the repl output:


roch=> (def raw-date "20200201")
roch=> (def year (subs raw-date 0 4))
roch=> (def month (subs raw-date 4 6))
roch=> (def day (subs raw-date 6 8))
roch=> (pr (str year "-" month "-" day))
roch=> java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn [at line 67, column 93]


@alex-eberts can't reproduce, which version are you using? if I can create a repro using version 0.1.3 that would be helpful


@alex-eberts have you redefined str to be a string?. Just eval str. What does that show? And what about evaling just pr?


@retrogradeorbit @borkdude Thanks for the hint! That turned out to be the problem… I must have redefined src previously in the repl session…. <facepalm>. Thanks!