Add Case control flow structre and remove css class
This commit is contained in:
parent
c0a545a817
commit
8cd37fc293
13
elixir.md
13
elixir.md
|
@ -105,7 +105,6 @@ Pattern matching works in function parameters too.
|
||||||
|
|
||||||
Control flow
|
Control flow
|
||||||
------------
|
------------
|
||||||
{: .-three-column}
|
|
||||||
|
|
||||||
### If
|
### If
|
||||||
|
|
||||||
|
@ -116,6 +115,18 @@ else
|
||||||
"This will"
|
"This will"
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
### Case
|
||||||
|
|
||||||
|
```elixir
|
||||||
|
case {1, 2, 3} do
|
||||||
|
{4, 5, 6} ->
|
||||||
|
"This clause won't match"
|
||||||
|
{1, x, 3} ->
|
||||||
|
"This clause will match and bind x to 2 in this clause"
|
||||||
|
_ ->
|
||||||
|
"This clause would match any value"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
### Cond
|
### Cond
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue