So far, we've covered the following:
- How to start the Erlang shell
- How to stop the Erlang shell:
q(). - How to use the shell as a super calculator
- How to use the math module: (e.g.
math:pi()) - How to explore the math module:
m(math). - How to create variables: (e.g.
Age = 100.) - How to check what variable bindings exist:
b(). - How to "forget" a specific variable binding:
f(Age). - How to "forget" all variable bindings:
f(). - How to do basic pattern matching
- How to create funs, which are anonymous functions
- What arity is: the number of arguments a function takes
So far, all of these operations have taken place in the shell. However, it turns out that the shell is not the best place to build larger programs: it's more like a test bed for simple ideas and a command center for running larger programs.
Many people would not have even discussed funs until much later, but since funs are the only way to write functions in the shell, I decided to talk about them first so you could really use the shell for experimentation.
We will move away from the shell in the next lesson and start writing bigger programs.
In the meantime, make sure you understand the points listed above and how to use them.
Next Stop: HiLo
