Data Types
Clojure provides a number of data types, most of which are unsurprising:
-
Vars provide mutable storage locations. These can be bound and rebound on a per-thread basis.
-
Booleans can have a value of true or false; nil values are also treated as false.
-
Numbers can be integers, doubles, floats, and fractions.
-
Symbols are used as identifiers for variables.
-
Keywords are symbols that reference themselves and are denoted by a colon; these are often used as keys in maps.
-
Strings are denoted by double quotes and can span multiple lines.
-
Characters are denoted by a forward slash.
-
Regular expressions are strings prefixed with a hash symbol.
In addition to the data types, Clojure provides a rich set of standard collections. These include lists, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access