Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang - Can a module name start with a capital letter?

Tags:

erlang

Erlang Can a module name start with a capital letter?

like image 363
homebrew Avatar asked Dec 03 '22 10:12

homebrew


1 Answers

A module name is an atom, so it must normally start with a lowercase letter, unless you enclose it in single quotes. This is actually possible:

%% in Foo.erl
-module('Foo').
...

%% in Erlang shell
1> 'Foo':foo().
"foo"

But completely horrible, so don't do this.

like image 68
Ben James Avatar answered Feb 12 '23 19:02

Ben James