|all||Well-known platform feature names||Each platform has a well-known platform feature when loading or compiling source files.|
|all||Reader syntax for conditional expressions|
read-cond or #?(feature expr ...) - alternating feature and expression (similar to cond). First feature that is included in the current feature set will result in the expr being read.
(defn my-trim [s]
|all||Reader syntax for conditional spliced expressions||read-cond-splicing or #?@(feature expr ...) - same as read-cond, but expression must be a java.util.List and will be spliced into the resulting read.|
|all||Reader syntax for conditional read :default|
If no feature is matched in #? or #?@, :default is a well-known keyword indicating a default expression to use instead. If no expression is chosen, nothing (not nil, but literally nothing) is read.
#?(:clj (Foo.) :default )
Allow reader conditional read mode with reader option
In allow mode, reader conditional syntax is allowed. Reader conditionals are evaluated and replaced with the result of the appropriate branch.
Reading source files containing reader conditionals without this option results in a runtime exception.
|all||Preserve reader conditional read mode with reader option|
In preserve mode, the reader-conditional is not replaced by the selected branch but instead returned as a form containing all branches. Tagged literals and nested reader-conditionals in all non-chosen branches will be represented in data form.
|all||Read-conditional data instance||In preserve mode, this instance may be returned. See below for details on what it supports.|
;; Construct like:
|all||Type-independent tagged literal data instance||In preserve mode, this instance may be returned. See below for details on what it supports.|
;; Construct like:
|all||New .cljc extension indicating a portable source file|
Clojure, ClojureScript, and ClojureCLR should load both .cljc (which may have reader conditionals) and their own platform-specific files as source files.
For .cljc files: the reader will be invoked with read-cond mode :allow.
For .clj/.cljs files: the reader will be invoked with read-cond disabled. All other read modes (such as the repl) will disable reader conditionals by default. The reader may be invoked with appropriate options to enable this mode.
The platform feature will be one of:
cljr. The platform feature will always be available when reading. The features
none are reserved.