Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 02dcc00

Browse files
author
José Valim
committed
Merge pull request elixir-lang#140 from komiga/master
Fix typos and normalize syntax highlighting in chapters 1, 2, and 3 of Getting Started
2 parents 729641b + ff846ac commit 02dcc00

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

getting_started/1.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ true
249249

250250
> Note: If you are an Erlang developer, `and` and `or` in Elixir actually map to the `andalso` and `orelse` operators in Erlang.
251251
252-
Besides these boolean operators, Elixir also provides `||`, `&&` and `!` which accept arguments of any type. For these operators, all values except `false` and `nil` will evaluate to true:
252+
Besides these boolean operators, Elixir also provides `||`, `&&` and `!` which accept arguments of any type. For these operators, all values except `false` and `nil` will evaluate to `true`:
253253

254254
```iex
255255
# or

getting_started/2.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ iex> "h\xE9ll\xF2"
245245
"héllò"
246246
```
247247

248-
UTF-8 also plays nicely with pattern matching. In the exemple below, we are extracting the first UTF-8 codepoint of a String and assigning the rest of the string to the variable `rest`:
248+
UTF-8 also plays nicely with pattern matching. In the example below, we are extracting the first UTF-8 codepoint of a String and assigning the rest of the string to the variable `rest`:
249249

250250
```iex
251251
iex> << eacute :: utf8, rest :: binary >> = "épa"
@@ -638,11 +638,11 @@ else
638638
end
639639
```
640640

641-
In Elixir, all values except `false` and `nil` evaluate to `true`. Therefore there is no need to explicitly convert the `if` argument to a boolean. If you want to check if one of many conditions are true, you can use the `cond` macro.
641+
In Elixir, all values except `false` and `nil` evaluate to `true`. Therefore there is no need to explicitly convert the `if` argument to a boolean. If you want to check if one of many conditions are `true`, you can use the `cond` macro.
642642

643643
### 2.6.7 Cond
644644

645-
Whenever you want to check for many conditions at the same time, Elixir allows developers to use `cond` insted of nesting many `if` expressions:
645+
Whenever you want to check for many conditions at the same time, Elixir allows developers to use `cond` instead of nesting many `if` expressions:
646646

647647
```elixir
648648
cond do
@@ -655,7 +655,7 @@ cond do
655655
end
656656
```
657657

658-
If none of the conditions return true, an error will be raised. For this reason, it is common to see a last condition equal to `true`, which will always match:
658+
If none of the conditions return `true`, an error will be raised. For this reason, it is common to see a last condition equal to `true`, which will always match:
659659

660660
```elixir
661661
cond do

getting_started/3.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ end
194194

195195
If we save the code above in a file named "concat.ex" and compile it, Elixir will emit the following warning:
196196

197-
test_funs.ex:7: this clause cannot match because a previous clause at line 2 always matches
197+
concat.ex:7: this clause cannot match because a previous clause at line 2 always matches
198198

199199
The compiler is telling us that invoking the `join` function with two arguments will always choose the first definition of `join` whereas the second one will only be invoked when three arguments are passed:
200200

201-
$ iex test_funs.ex
201+
$ iex concat.ex
202202

203203
```iex
204204
iex> Concat.join "Hello", "world"

0 commit comments

Comments
 (0)