Welcome! This is a comprehensive reference for ClojureScript's syntax, standard library, and compiler API. See the Cheatsheet for quick reference
Documentation is versioned and supplemented by curated descriptions,examples, and cross-refs. Community contributions welcome.
Current Version: 1.11.132 | Version Table
Get these docs for Dash under User Contributed downloads.
Syntax forms, literals, conventions and patterns.
Literals | number literal | "" string | #"" regex | \ character | : keyword | :: keyword | symbol literal |
Special Symbols | true | false | nil |
Symbolic Values | ##NaN | ##Inf | ##-Inf |
Collections | [] vector | () list | {} map | #{} set | #:{} namespaced map | #::{} namespaced map |
Commenting | ; comment | #! shebang | #_ ignore |
Function | #() function | % arg | & rest |
Destructuring | destructure [] | destructure {} |
Conventions | ? predicate | ! impure | *earmuffs* | _ unused | whitespace | , comma |
Symbol Resolution | . dot | / namespace slash | js/ namespace | ^js | Math/ namespace |
Tagged Literals | # tagged literal | #js literal | #inst literal | #uuid literal | #queue literal |
Quoting | ' quote | ` syntax quote | ~ unquote | ~@ unquote splicing | # auto-gensym |
Vars | ^ meta | #' var | @ deref |
Reader Conditionals | #? reader conditional | #?@ reader conditional splicing |
Misc | # dispatch | #<> unreadable | #= eval |
:analyze-path | :bind-err | :caught | :compiler-env | :def-emits-var | :eval | :flush | :host | :init | :inits | :launch-browser | :need-prompt | :port | :print | :print-no-newline | :prompt | :quit-prompt | :read | :reader | :repl-requires | :repl-verbose | :source-map-inline | :src | :static-dir | :warn-on-undeclared | :watch | :working-dir | :wrap |
core library
compile/analyze ClojureScript code at runtime.
*eval-fn* | *load-fn* | *loaded* | analyze-str | compile-str | dump-core | empty-state | eval | eval-str | file->ns | js-eval | load-analysis-cache! | load-source-map! | ns->relpath | require | with-state |
E | IEEE-remainder | PI | acos | add-exact | asin | atan | atan2 | cbrt | ceil | copy-sign | cos | cosh | decrement-exact | exp | expm1 | floor | floor-div | floor-mod | get-exponent | hypot | increment-exact | log | log10 | log1p | multiply-exact | negate-exact | next-after | next-down | next-up | pow | random | rint | round | scalb | signum | sin | sinh | sqrt | subtract-exact | tan | tanh | to-degrees | to-radians | ulp |
nodejs support functions
enable-util-print! | process | require |
a pretty-printer for printing data structures
*print-base* | *print-miser-width* | *print-pprint-dispatch* | *print-pretty* | *print-radix* | *print-right-margin* | *print-suppress-namespaces* | char-code | cl-format | code-dispatch | deftype | float? | formatter | formatter-out | fresh-line | get-pretty-writer | getf | pp | pprint | pprint-indent | pprint-logical-block | pprint-newline | pprint-set | pprint-tab | print-length-loop | print-table | set-pprint-dispatch | setf | simple-dispatch | with-pprint-dispatch | with-pretty-writer | write | write-out | |
Types and Protocols | IPrettyFlush |
a reader to parse text and produce data structures
macros auto-imported into a ClojureScript REPL
Error->map | apropos | dir | doc | error->str | ex-str | ex-triage | find-doc | print-doc | pst | source |
& | * | *coll-check-limit* | *coll-error-limit* | *compile-asserts* | *explain-out* | *fspec-iterations* | *recursion-limit* | + | ? | MAX_INT | abbrev | alt | and | assert | assert* | cat | check-asserts | check-asserts? | coll-of | conform | conformer | def | describe | double-in | every | every-kv | exercise | exercise-fn | explain | explain-data | explain-data* | explain-out | explain-printer | explain-str | fdef | form | fspec | gen | get-spec | inst-in | inst-in-range? | int-in | int-in-range? | invalid? | keys | keys* | map-of | merge | multi-spec | nilable | nonconforming | or | regex? | registry | registry-ref | spec | spec? | speced-vars | tuple | unform | valid? | with-gen | |
Types and Protocols | Spec | Specize |
any | any-printable | bind | boolean | cat | char | char-alpha | char-alphanumeric | char-ascii | choose | delay | double | double* | dynaload | elements | fmap | for-all* | frequency | gen-for-pred | generate | hash-map | int | keyword | keyword-ns | large-integer | large-integer* | list | map | not-empty | one-of | quick-check | ratio | return | sample | set | shuffle | simple-type | simple-type-printable | string | string-alphanumeric | string-ascii | such-that | symbol | symbol-ns | tuple | uuid | vector | vector-distinct | |
Types and Protocols | LazyVar |
a unit-testing framework
*current-env* | are | assert-any | assert-expr | assert-predicate | async | async? | block | clear-env! | compose-fixtures | deftest | do-report | empty-env | file-and-line | function? | get-and-clear-env! | get-current-env | inc-report-counter! | is | join-fixtures | js-filename | js-line-and-column | mapped-line-and-column | ns? | report | run-all-tests | run-block | run-test | run-tests | run-tests-block | set-env! | successful? | test-all-vars | test-all-vars-block | test-ns | test-ns-block | test-var | test-var-block | test-vars | test-vars-block | testing | testing-contexts-str | testing-vars-str | try-expr | update-current-env! | use-fixtures | |
Types and Protocols | IAsyncTest |
Types and Protocols | Datafiable | Navigable |
a library for reduction and parallel folding (parallelism not supported)
append! | cat | drop | filter | flatten | fold | foldcat | folder | map | mapcat | monoid | reduce | reducer | remove | take | take-while | |
Types and Protocols | Cat | CollFold |
non-core data functions
diff | |
Types and Protocols | Diff | EqualityPartition |
datafy | nav |
read | read-string |
deprecated
doc | macroexpand | meta | print-doc |
set operations such as union/intersection
difference | index | intersection | join | map-invert | project | rename | rename-keys | select | subset? | superset? | union |
string operations
blank? | capitalize | ends-with? | escape | includes? | index-of | join | last-index-of | lower-case | replace | replace-first | reverse | split | split-lines | starts-with? | trim | trim-newline | triml | trimr | upper-case |
a generic tree walker for Clojure data structures
keywordize-keys | postwalk | postwalk-replace | prewalk | prewalk-replace | stringify-keys | walk |
functional hierarchical zipper, w/ navigation/editing/enumeration
append-child | branch? | children | down | edit | end? | insert-child | insert-left | insert-right | left | leftmost | lefts | make-node | next | node | path | prev | remove | replace | right | rightmost | rights | root | seq-zip | up | vector-zip | xml-zip | zipper |
programmatic access to the analyzer (producing AST)
programmatic access to project-building facilities
programmatic access to the compiler (emitting JS)
cljs-files-in | compile-file | compile-root | emit | munge | requires-compilation? | with-core-cljs |
macros auto-imported into a ClojureScript REPL
*cljs-verbose* | *repl-env* | *repl-opts* | add-url | analyze-source | apropos | compilable? | decorate-specs | default-special-fns | demunge | dir | doc | eval-cljs | evaluate | evaluate-form | ex-str | ex-triage | file-display | find-doc | initial-prompt | js-src->cljs-src | known-repl-opts | load | load-file | load-namespace | load-stream | mapped-stacktrace | maybe-install-npm-deps | ns->input | ns-info | print-mapped-stacktrace | pst | read-source-map | repl | repl* | repl-caught | repl-nil? | repl-options | repl-prompt | repl-quit-prompt | repl-read | repl-special-doc-map | repl-title | run-inits | setup | skip-if-eol | skip-whitespace | source | source-fn | special-doc-map | tear-down | |
Types and Protocols | IGetError | IJavaScriptEnv | IParseError | IParseStacktrace | IPrintStacktrace | IReplEnvOptions |
browser-connected REPL
-main | add-in-order | browser-eval | browser-state | constrain-order | default-index | es | ext->mime-type | handle-post | load-javascript | lock | mime-type->encoding | ordering | outs | repl-client-js | repl-env | repl-env* | run-in-order | send-for-eval | send-repl-client-page | send-static | serve | setup | thread-name |
Nashorn REPL (JS on Java 8)
Node.js REPL
-main | close-socket | create-socket | errs | load-javascript | lock | node-eval | outs | platform-path | read-response | repl-env | repl-env* | results | seq->js-array | setup | thread-name | write |
handle-reflect-query | macroexpand | parse-param | read-url-string |
Rhino REPL (JS on Java 6+)
connection | connq | dispatch-on | gzip | handlers | lock | parse-file-parts | parse-headers | promiseq | read-get | read-headers | read-post | read-request | send-404 | send-and-close | set-connection | start | state | stop |