Skip to Content
Introducing Erlang
book

Introducing Erlang

by Simon St. Laurent
January 2013
Beginner to intermediate content levelBeginner to intermediate
204 pages
4h 26m
English
O'Reilly Media, Inc.
Content preview from Introducing Erlang

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. If you want much much more, see http://www.erlang.org/doc/reference_manual/users_guide.html.

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 be able to have something ...

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

Building Web Applications with Erlang

Building Web Applications with Erlang

Zachary Kessin
Études for Erlang

Études for Erlang

J. David Eisenberg
Erlang by Example with Cesarini and Thompson

Erlang by Example with Cesarini and Thompson

Simon Thompson, Francesco Cesarini
Erlang and OTP in Action

Erlang and OTP in Action

Eric Merritt, Richard Carlsson, Martin Logan

Publisher Resources

ISBN: 9781449331757Supplemental ContentErrata