Error formatting macro: pagetree: java.lang.NullPointerException
Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History


I'm writing a type checker for Clojure code that utilizes a modified version ClojureScript analyzer.

I have made some changes to the analyzer to analyze Clojure code, instead of ClojureScript.

These changes could form the basis of a generalized analyze library to be called a la carte.


  • The ClojureScript compiler could use this more general library
    • Should keep in mind ClojureScript's usage

Differences running the analyzer on Clojure code

(In progress)

Differences in 'ns syntax

  • Unqualified :use and :require are legal in Clojure
  • :use/require-macros don't exist in Clojure

Resolving macro expanders

  • Should look for macro expanders in :use and :require instead of :use-macros and :require-macros

Keeping metadata on fn args

  • Something I found helpful for annotating types. Possibly alternative strategy Question Mark

Remove namespace substitution of 'cljs.core from 'clojure.core

  • All vars that resolve to clojure.core have their namespace substituted for cljs.core
    • (def ^:dynamic *subst-clojure-core-ns* 'clojure.core)

Analyzer doesn't understand macros (defmacro's)

  • The analyzer doesn't define a new macro when parsing/analyzing a defmacro form
    • This doesn't matter with CLJS code, can't define new macros.
      • Can in Clojure code though.

Initial Namespacing Environment

  • Should be clojure.core and clojure.user, instead of cljs.core/user

Munging js-reserved symbols

  • Special case not applicable to Clojure