Clojure: Basic Syntax

By Xah Lee. Date: . Last updated: .

Comma and Space

comma can be used as separator.

;; comma can be used as separator
;; the following are equivalent
(+ 1 2 3) ; 6
(+ 1, 2  , 3) ; 6

Comment

Printing

Strings

Numbers

Block of Expressions

Variables

True and False

Flow Control

Iteration

Collection and Sequence: list, vector, hash table …

Defining a Function

Basic Value Types

Namespace

Regex