             [_#]
             (reduce
               (fn [vs# th#]
+                ;; In Clojure the module-loading will store the Vars
+                ;; themselves so we can just deref them, but in
+                ;; Clojurescript vars aren't reified at runtime, so
+                ;; module loading passes thunks
                 (~add-fn vs# (~(if clojure?
                                  `deref
                                  `(fn [x#] (x#)))

(defmacro gen-module-requires
  "Generate the `require` statements to pull in all necessary
  namespaces to be able to connect the modules. That is, all the
  namespaces named in both `:extends` and `:provides`."
  []
  (let [modules (read-all-modules)
        provides (->> modules

(ns braid.core.module-helpers
  "Helpers for the Braid module system.
  The important things here are:
  - The `defhook` macro, which Clojure & Clojurescript should use to
    define extension points for modules
  - The `gen-module-requires` and `gen-module-loads` macros, which
    `modules.cljs` uses to set up cljs module extensions"
  (:require
   [clojure.tools.reader.edn :as edn]
   [clojure.java.io :as io]))
