Why are variables in Erlang capitalized to start with?

I am new to Erlang and just wondering why variables are designed to start with a capital letter that is so different from the one in other languages?

Perhaps because it is immutable?

+6
source share
2 answers

Earlier versions of Erlang were implemented in Prolog, and just like Prolog, Erlang variables start with either a capital letter or underscore.

+10
source

In addition to what @SteveVinoski said,

Starting with a capital letter, it separates variables from atoms, which are often used in the Erlang code. Atoms always begin with a lowercase letter. The name of the modules and functions are atoms.

+5
source

Source: https://habr.com/ru/post/981984/


All Articles