Language Features

Learn the characteristics of the set of ideas that Lisp incorporates and that Clojure also uses.

Syntax and semantics

Clojure is a Lisp dialect, which means that it follows many properties of Lisp and also its grammar. Lisp’s syntax is a bit different from any other programming language; it’s all about parentheses. After understanding the concept and how to read Clojure’s syntax, the use of parentheses will become clearer.

Note: In the examples up till now, everything is put around parentheses (). So we can accept that the parenthesis is the execution call to anything that we do. However, as in any other programming language, parentheses also signify the definition of a list as a data structure.

How do we read it?

We’ll notice that everything is a function call, a definition of a function, access to a collection, or a symbol, and all the other elements are the necessary arguments to perform these functions.

Here, we can see a real example:

Press + to interact
(def my-variable (+ 2 3))

Here, def is a predefined function that stores a variable. In the def function, we pass my-variable, which represents the name we’re defining and the function we’re attributing to it. In the ...

Access this course and 1400+ top-rated courses and projects.