Anon
Anon

Reputation: 109

Basic Erlang module troubles

So I straight up copy and pasted the code from the Erlang docs: https://erlang.org/doc/reference_manual/modules.html#module-syntax

This should explain everything

Please help!

Upvotes: 2

Views: 257

Answers (2)

Nalin Ranjan
Nalin Ranjan

Reputation: 1782

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.

Upvotes: 0

vkatsuba
vkatsuba

Reputation: 1449

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.

Upvotes: 4

Related Questions