Fork me on GitHub
#babashka
<
2020-08-13
>
grzm02:08:37

When connecting to a babashka nrepl-server via CIDER, and requiring camel-snake-kebab.core, I’m seeing

clojure.lang.ExceptionInfo: Can't change/establish root binding of #'*warn-on-reflection* with set [at camel_snake_kebab/internals/string_separator.cljc, line 4, column 1]

grzm02:08:07

Using the same class path, requiring it from bb directly works just fine. (e.g.,

bb --classpath $(clojure -A:bb -Spath) "(require '[camel-snake-kebab.core :as csk]) (csk/->kebab-case :FooBar)" 
:foo-bar

grzm02:08:56

What magical incantation am I missing in my setup?

borkdude08:08:59

This is a bug in the nREPL server. Temporary workaround:

(binding [*warn-on-reflection* true]
  (require '[camel-snake-kebab.core :as csk]))
I'll make an issue

grzm13:08:29

Cheers! and cheers!

borkdude16:08:41

Fixed on master

borkdude18:08:22

No problem, thanks for mentioning

jhacks22:08:54

Is it possible to get the name the bb script was called as, similar to $0 in bash? I have a symbolic link from ~/bin to the directory with the babashka script. In the “usage” message, I’d like to use the symbolic link name instead of the file name of the script, since they’re different. *file* gives me the file name, not the link name.