for var1 <- generator1,
var2 <- generator2,
new_var = some_expr(var1, var2),
a_check?(new_var) do
operation_to_generate_final_value(var1, var2)
end
Sigils support 8 different delimiters - //, ||, "", '', (), [], {}, <>.
| Sigil | Explaination |
|---|---|
|
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 | Explaination | Code | Explaination |
|---|---|---|---|
|
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.
| Operation | 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