Erlang shell
- User switch command: C-g
- q -> quit
- j -> list shells
- c 2 -> connect to shell 2
- k 2 -> kill shell 2
Integers
Atoms
Tuples
Lists
Variables
- Starts with uppercase or underscore
- Variables can only be bound once
Functions
- Implicit returns
- Expressions separated by comma
- Clauses separated by semicolon
- Terminate function definition with dot.
Modules
- Module name has to match the file name.
Connecting to other nodes in shell
$ erl -sname foo
foo@nithin>
$ erl -sname bar
bar@nithin>
From bar@nithin, C-g and then r 'foo@nithin'
.
Case
Guards
Recursion with lists
Processes
Random notes and thoughts
- “Equals” actually means “pattern match”
- “Variable” means binding
- An erlang process has just 200-300 words
- BIF - built in fn
Bookmarks
Books: