Sigils support 8 different delimiters - //
, ||
, ""
, ''
, ()
, []
, {}
, <>
.
Sigil | Explanation |
---|---|
|
Regular Expression |
|
String (binary) |
|
Char list |
|
Word list of strings (binaries) |
|
Word list of char lists |
|
Word list of atoms |
The following escape codes can be used in strings and char lists:
Code | Explanation | Code | Explanation |
---|---|---|---|
|
single backslash |
|
bell/alert |
|
backspace |
|
delete |
|
escape |
|
form feed |
|
newline |
|
carriage return |
|
space |
|
tab |
|
vertical tab |
|
null byte |
|
represents a single byte in hexadecimal (such as \x13) |
|
represents a Unicode codepoint in hexadecimal (such as \u{1F600}) |
A double quote literal inside a double quoted string also needs to be escaped.
Various metaprogramming variables and macros.
Expression | Explanation |
---|---|
|
A struct containing details about the compilation environment |
|
Define a macro |
|
Convert the code inside the block to AST |
|
Use to inject values from outside of the |
|
The using macro |
|
Expands to the module name of the current module |
|
|
|
|
|
Operation | List | Keyword List | Map | Struct |
---|---|---|---|---|
Define |
---- defmodule Person do defstruct first_name: "", last_name: "" end ---- |
|||
Create |
|
|
|
|
Match |
|
|
|
|
Update |
|
|
|
for var1 <- generator1,
var2 <- generator2,
new_var = some_expr(var1, var2),
a_check?(new_var) do
operation_to_generate_final_value(var1, var2)
end