I was curious about what certain macros were doing and tried to call (macroexpand-1) to get more info. However, I'm a little confused about how to expand the built-in macros in ClojureScript, particularly the macros in the cljs.core namespace. According to the docs, ClojureScript macros are written in Clojure and therefore have to be tested in a Clojure REPL (instead of a ClojureScript REPL), which is where I've been trying this from.
Running lein repl from my ClojureScript project's directory, I've tried this:
=> (require 'cljs.compiler)
=> (require 'cljs.core)
=> (macroexpand-1 '(cljs.core/int 99.9))
(macroexpand-1 '(cljs.core/int 99.9))
(cljs.core/int 99.9)
Why does that return (cljs.core/int 99.9)? Based on the ClojureScript source, shouldn't that macro expand to something like (bit-or ~x 0)?
When I expand non-ClojureScript macros, such as (macroexpand-1 '(when (even? 2) (println "2 is even"))), the expansion seems to work fine.
Seems like I'm missing something conceptually...