Skip to content
Ambrose Bonnaire-Sergeant edited this page Feb 8, 2013 · 2 revisions

Low hanging fruit (Contributions needed)

The two main activities crucial in these early versions of core.typed are

  1. Porting existing untyped code to typed
  2. Typing core Clojure functions

These processes will reveal bugs in type checker and expressiveness limitations of core.typed types. For example, currently keyword parameters are not supported.

Watch the first three episodic screencasts (above) that demonstrate some of the techniques involved in these activities.

Often if a core function is untyped, the type can be temporarily added via your own namespace with ann. This also applies to Clojure's clojure.lang Java classes (alter-class) and methods (override-method, non-nil-return, nilable-param) (raw method calls often result from inlining core functions).

Core Clojure function annotations belong in the typed/ann.clj file. They should be fully namespace qualified, like (ann clojure.core/*ns* clojure.lang.Namespace).

Porting a namespace involves

  • annotating var defs from the current namespace with ann, conventionally above the def
  • checking the namespace with check-ns (calling with zero arguments checks the current namespace)
  • adding missing core Clojure annotations with ann temporarily in the current namespace
  • wrapping troublesome top-level forms with tc-ignore so they skip type-checking
Clone this wiki locally