Skip to main content
TheFocus.Quest

Clojure and ClojureScript are not identical

Take away

(not (== ClojureScript Clojure))

As I tackle my first project with Clojure(Script), I have had the CheatSheet open most of the time for the past few weeks. Note that it's the Clojure cheatsheet, not the ClojureScript cheatsheet.

Today, I was following up on an implementation that uses walk (some form of it which I haven't quite figured out yet) to apply Tailwind classes to a hiccup structure. I wasn't getting the results I needed, prewalk leading to too much recursion errors, and postwalk leading to transformation of structures I didn't want to touch.

So, I saw postwalk-demo in the cheatsheet and wrote a simple test to run through the REPL, but got an error: clojure.walk.postwalk_demo is undefined. I thought I may be doing something wrong with the import, and wrestled with it for a bit.

I visited the ClojureScript API Documentation and then I found that while the walk functions are implemented, the -demo ones are not.

Also, note that the ClojureScript CheatSheet makes no mention of the walk functions, even though they are part of the language.

On the bright side, I love how accessible the documentation is, and how easy it was to clear up this confusion.