(ns net.cgrand.macrovitch)

(defmacro deftime
  "This block will only be evaluated at the correct time for macro definition, at other times its content
   are removed.
   For Clojure it always behaves like a `do` block.
   For Clojurescript/JVM the block is only visible to Clojure.
   For self-hosted Clojurescript the block is only visible when defining macros in the pseudo-namespace."
  [& body]
  (when #?(:clj (not (:ns &env)) :cljs (re-matches #".*\$macros" (name (:name (:ns &env)))))
    `(do ~@body)))

(defmacro usetime
  "This block content is not included at macro definition time.
   For Clojure it always behaves like a `do` block.
   For Clojurescript/JVM the block is only visible to Clojurescript.
   For self-hosted Clojurescript the block is invisible when defining macros in the pseudo-namespace."
  [& body]
  (when-not #?(:clj (not (:ns &env)) :cljs (re-matches #".*\$macros" (name (:name (:ns &env)))))
    `(do ~@body)))

(prn "E")

(defmacro emit-case [& {:keys [cljs clj]}]
  (if #?(:clj (:ns &env) :cljs true)
    cljs
    clj))

(prn "F")

(defmacro ns-name2 [] (:ns &env))