Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Lists

Tele's lists have the exact same syntax as Erlang.

[1, 2, 3]

In functional languages it is common to "cons" or make a new list with an element prepended to the original.

The syntax for that looks like this:

l = [2, 3]
l2 = [1 | l]

l2 will now look like this:

[1, 2, 3]

We can cons multiple elements as well:

l = [4, 5, 6]
[1, 2, 3 | l]