Why does Erlang allow an atom to include the @ signs? Does it have practical application?

Erlang Official User Guide ( http://erlang.org/doc/reference_manual/data_types.html#id67942 ):

An atom must be enclosed in single quotation marks (') if it does not start with a lowercase letter or if it contains characters other than alphanumeric characters, an underscore (_) or @.

Why does Erlang allow an atom to include the @ signs? Does it have practical use or any historical meaning?

+5
source share
1 answer

Does it have practical use

Yes Yes. Node names in Erlang are represented as atoms, and they contain @ , separating the name and host. The @ resolution in atoms without single quotes makes them convenient for entering them (unless they contain other special characters, such as . Or - ).

 $ erl 1> foo@bar. foo@bar 
+8
source

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


All Articles