typed.clojure
Wrapper macros that do the right thing for each platform.
See typed.clojure.jvm for jvm-specific ops.
ann
macro
(ann varsym typesyn)
Annotate varsym with type. If unqualified, qualify in the current namespace.
If varsym has metadata {:no-check true}, ignore definitions of varsym
while type checking. Supports namespace aliases and fully qualified namespaces
to annotate vars in other namespaces.
eg. ; annotate the var foo in this namespace
(ann foo [Number -> Number])
; annotate a var in another namespace
(ann another.ns/bar [-> nil])
; don't check this var
(ann ^:no-check foobar [Integer -> String])
ann-datatype
macro
(ann-datatype & args)
ann-many
macro
(ann-many & args)
ann-protocol
macro
(ann-protocol & args)
ann-record
macro
(ann-record & args)
atom
macro
(atom & args)
Like atom, but with optional type annotations.
Same as (atom (ann-form init t) args*)
eg. (atom 1) : (Atom (Value 1))
(atom :- Num, 1) : (Atom Num)
cf
macro
(cf & args)
In Clojure, expands to (clojure.core.typed/cf ~@args).
In ClojureScript JVM, expands to (cljs.core.typed/cf ~@args).
cf-clj
macro
(cf-clj & args)
Check a Clojure form in the current *ns*.
cf-cljs
macro
(cf-cljs & args)
Check a ClojureScript form in the same namespace as the current platform.
check-dir-clj
(check-dir-clj dirs)
check-dir-cljs
(check-dir-cljs dirs)
check-ns-clj
(check-ns-clj)
(check-ns-clj ns-or-syms & {:as opt})
In Clojure, checks the current namespace or provided namespaces.
Similar for self-hosted ClojureScript, except for macros namespaces.
check-ns-cljs
(check-ns-cljs)
(check-ns-cljs & args)
cns
macro
(cns & args)
In Clojure, expands to (check-ns-clj ~@args).
In ClojureScript JVM, emulates calling (check-ns-cljs ~@args) at expansion time
(note: args will not be evaluated).
Self hosted ClojureScript semantics TBD.
Only suitable for REPL development:
1. (t/cns) or (t/cns 'my-ns.foo)
2. Fix type errors, save file, go back to 1 until fixed.
Not compatible with AOT compilation.
declare-alias-kind
macro
(declare-alias-kind & args)
declare-datatypes
macro
(declare-datatypes & args)
declare-names
macro
(declare-names & args)
declare-protocols
macro
(declare-protocols & args)
defalias
macro
(defalias & args)
defprotocol
macro
(defprotocol & args)
doc-clj
macro
(doc-clj syn)
Pass any syntax fragment related to Typed Clojure to print documentation on it.
eg., (doc-clj t/Rec)
(doc-clj '[])
(doc-clj +) ;; print var annotation
(doc-clj MyAlias) ;; print defalias mapping
Use :doc/index for documentation index.
doc-cljs
macro
(doc-cljs syn)
Pass any syntax fragment related to Typed Clojure to print documentation on it.
eg., (doc-cljs t/Rec)
(doc-cljs '[])
(doc-cljs +) ;; print var annotation
(doc-cljs MyAlias) ;; print defalias mapping
Use :doc/index for documentation index.
inst-ctor
macro
(inst-ctor & args)
tc-ignore
macro
(tc-ignore & args)