Skip to Content
Introducing Erlang, 2nd Edition
book

Introducing Erlang, 2nd Edition

by Simon St. Laurent
March 2017
Beginner
212 pages
4h 47m
English
O'Reilly Media, Inc.
Content preview from Introducing Erlang, 2nd Edition

Appendix A. An Erlang Parts Catalog

Like every language, Erlang has drawers full of parts that are fun to peruse. These are a very few of the more common ones. For much much more, see http://bitly.com/10CiiKR.

Shell Commands

You can use most Erlang functions from the shell, but these are ones that are exclusive to the shell.

Table A-1. Erlang shell commands
Command Action

q()

Quits the shell and the Erlang runtime

c(file)

Compiles the specified Erlang file

b()

Displays all variable bindings

f()

Clears all variable bindings

f(X)

Clears specified variable binding

h()

Prints the history list of commands

e(N)

Repeats the command on line N

v(N)

The return value of line N

catch_exception(boolean)

Sets how strict the shell will be in passing errors

rd(Name,Definition)

Defines a record type Name with contents specified by Definition

rr(File)

Defines record types based on the contents of File

rf()

Clears all record definitions. Can also clear specific definitions

rl()

Lists all current record definitions

pwd()

Gets the present working directory

ls()

Lists files at the current location

cd(Directory)

Changes to the specified Directory

Reserved Words

There are a few Erlang terms you can’t use outside of their intended context.

The Erlang compiler will wonder what you’re trying to do if you use certain keywords as atoms or function names. It will try to treat your atoms as if they were code, and you can get very strange errors. After all, you should ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Erlang Programming

Erlang Programming

Francesco Cesarini, Simon Thompson
Erlang and OTP in Action

Erlang and OTP in Action

Eric Merritt, Richard Carlsson, Martin Logan
Introducing Erlang

Introducing Erlang

Simon St. Laurent

Publisher Resources

ISBN: 9781491973363Errata PageSupplemental Content