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

Identifiers in Elixir are combinations of upper- and lowercase ASCII characters, digits, and underscores. They may end with a question mark or an exclamation point.

Module, record, protocol, and behaviour names start with an uppercase letter and are bumpycase (like this: 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 ...

Get Programming Elixir 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.