Introducing Erlang: Getting Started in Functional Programming by Marcos Benevides
:ID: f5e7bb90-792d-406a-8c40-2b072db63a13
Chapter 1: Getting Comfortable
Numbers in Erlang
If you need to do calculations on integers using a base other than 10, you can use Base#Value notation.
Seeing Your Bound Variables
b()
shows all bound variables in the current erlang shell.
> b().
N = 1
Number = 5
Clearing Bound Variables in the Shell
> f(N).
> f().
Chapter 2: Functions and Modules
Defining Modules
-module(drop).
-export([fall_velocity/1, mps_to_mph/1, mps_to_kph/1]).
fall_velocity(Distance) -> math:sqrt(2 * 9.8 * Distance).
mps_to_mph(Mps) -> 2.23693629 * Mps.
mps_to_kph(Mps) -> 3.6 * Mps.