Basic Erlang module troubles

Viewed 88
2 Answers

The module didn't compiled. To fix it try this in the Erlang shell (eshell):

1> c(m).
ok
2> m:fact(1).
1

See documentation on how code loading works.

exception error: undefined shell command almost always means that the shell environment does not have the intended function, which can also mean that the module which contains its definition has not been loaded for all the code that we write by our hand and execute. You can deliberately try to misspell some auto loaded BIF(s) for example "length1" and you will still see same message showing up.

Related