Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Low Hanging Fruit

Ambrose Bonnaire-Sergeant edited this page Jan 4, 2013 · 1 revision

Low hanging fruit (Contributions needed)

The two main activities crucial in these early versions of Typed Clojure 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 Typed Clojure 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