Wrapper macros that do the right thing for each platform. See typed.clojure.jvm for jvm-specific ops.
Wrapper macros that do the right thing for each platform. See typed.clojure.jvm for jvm-specific ops.
(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])
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])(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)
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 & args)In Clojure, expands to (clojure.core.typed/cf ~@args). In ClojureScript JVM, expands to (cljs.core.typed/cf ~@args).
In Clojure, expands to (clojure.core.typed/cf ~@args). In ClojureScript JVM, expands to (cljs.core.typed/cf ~@args).
(cf-clj & args)Check a Clojure form in the current ns.
Check a Clojure form in the current *ns*.
(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.
In Clojure, checks the current namespace or provided namespaces. Similar for self-hosted ClojureScript, except for macros namespaces.
(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:
Not compatible with AOT compilation.
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.
(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.
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.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |