Names, Source Files, Conventions, Operators, and So On

Elixir identifiers consist of upper- and lowercase ASCII characters, digits, and underscores. They may end with a question or an exclamation mark.

Module, record, protocol, and behavior names start with an uppercase letter and are BumpyCase. All other identifiers start with a lowercase letter or an underscore, and by convention use underscores between words. If the first character is an underscore, Elixir doesn’t report a warning if the variable is unused in a pattern match or function parameter list.

Source files are written in UTF-8, but identifiers may use only ASCII.

By convention, source files use two-character indentation for nesting—and they use spaces, not tabs, to achieve this. ...

Get Programming Elixir 1.3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.