Fork me on GitHub
#clojurescript
<
2024-07-06
>
Matheus Inacio13:07:08

is there any default function to kebabify keywords when doing js->clj ? I did spin up my own with

(defn kebabify [s]
  (-> s
      (clojure.string/replace #"([a-z])([A-Z])" "$1-$2")
      (clojure.string/lower-case)))
and
(defn my-js->clj
...
keyfn (if keywordize-keys keyword str)
keyfn (if kebabify-keys (comp keyfn kebabify) keyfn)
...
but I may be reinventing the wheel here?

p-himik16:07:35

There's munge but it makes other changes as well:

cljs.user=> (munge "a-b")
"a_b"
cljs.user=> (munge "a-b*")
"a_b_STAR_"

👀 1
sharky20:07:25

I am trying to follow the repl seems to be weird or broken

sharky20:07:47

cljs.user=> (+ 1 1)

rlwrap: warning: rlwrap appears to do nothing for clojure, which asks for
single keypresses all the time. Don't you need --always-readline
and possibly --no-children? (cf. the rlwrap manpage)

warnings can be silenced by the --no-warnings (-n) option

sharky20:07:11

Does the clj repl behaves differently compared to clojures ?

Bob B20:07:37

clj wraps clojure in rlwrap

p-himik21:07:51

There's a chance you have an outdated version of rlwrap. Or maybe there's something in your ~/.inputrc that makes that warning appear.