Skip to content

Commit 3c3cf14

Browse files
committed
Fixed legacy typos in Kernel
1 parent 45454eb commit 3c3cf14

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

lib/elixir/lib/kernel.ex

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,16 +1272,16 @@ defmodule Kernel do
12721272
12731273
## Nesting
12741274
1275-
Nesting a module inside the other affects its name:
1275+
Nesting a module inside another module affects its name:
12761276
12771277
defmodule Foo do
12781278
defmodule Bar do
12791279
end
12801280
end
12811281
1282-
In the example above, two modules `Foo` and `Foo.Bar`. The
1282+
In the example above, two modules `Foo` and `Foo.Bar` are created. The
12831283
second can be accessed as `Bar` inside `Foo` in the same
1284-
lexical scope. If the module Bar is moved away to another
1284+
lexical scope. If the module `Bar` is moved to another
12851285
file, it needs to be referenced via the full name or an
12861286
alias need to be set with the help of `Kernel.SpecialForms.alias/2`.
12871287
@@ -1360,7 +1360,7 @@ defmodule Kernel do
13601360

13611361
@doc """
13621362
Defines a function that is private. Private functions are
1363-
only accessible from the same module in which they are defined.
1363+
only accessible from within the module in which they are defined.
13641364
13651365
Check `def/2` for more information
13661366
@@ -1671,10 +1671,9 @@ defmodule Kernel do
16711671
end
16721672

16731673
@doc """
1674-
Define elem to get Tuple element according to Elixir conventions
1675-
(i.e. it expects the tuple as first argument, zero-index based).
1674+
Get the element at the zero-based `index` in `tuple`.
16761675
1677-
It is implemented as a macro so it can be used in guards.
1676+
Implemented as a macro so it can be used in guards.
16781677
16791678
## Example
16801679
@@ -1692,8 +1691,7 @@ defmodule Kernel do
16921691
end
16931692

16941693
@doc """
1695-
Define set_elem to set Tuple element according to Elixir conventions
1696-
(i.e. it expects the tuple as first argument, zero-index based).
1694+
Sets the element in `tuple` at the zero-based `index` to the given `value`.
16971695
16981696
## Example
16991697
@@ -1711,9 +1709,7 @@ defmodule Kernel do
17111709
end
17121710

17131711
@doc """
1714-
Define insert_elem to insert element into a tuple according to
1715-
Elixir conventions (i.e. it expects the tuple as first argument,
1716-
zero-index based).
1712+
Inserts `value` into `tuple` at the given zero-based `index`.
17171713
17181714
## Example
17191715
@@ -1730,9 +1726,7 @@ defmodule Kernel do
17301726
end
17311727

17321728
@doc """
1733-
Define delete_elem to delete element from a tuple according to
1734-
Elixir conventions (i.e. it expects the tuple as first argument,
1735-
zero-index based).
1729+
Deletes the element at the zero-based `index` from `tuple`.
17361730
17371731
Please note that in versions of Erlang prior to R16B there is no BIF
17381732
for this operation and it is emulated by converting the tuple to a list
@@ -2737,24 +2731,24 @@ defmodule Kernel do
27372731
27382732
if(foo, do: bar)
27392733
2740-
In the example above, bar will be returned if foo evaluates to
2741-
true (i.e. it is not false nor nil). Otherwise, nil will be returned.
2734+
In the example above, `bar` will be returned if `foo` evaluates to
2735+
`true` (i.e. it is neither `false` nor `nil`). Otherwise, `nil` will be returned.
27422736
2743-
An else option can be given to specify the opposite:
2737+
An `else` option can be given to specify the opposite:
27442738
27452739
if(foo, do: bar, else: baz)
27462740
27472741
## Blocks examples
27482742
2749-
Elixir also allows you to pass a block to the if macro. The first
2743+
Elixir also allows you to pass a block to the `if` macro. The first
27502744
example above would be translated to:
27512745
27522746
if foo do
27532747
bar
27542748
end
27552749
2756-
Notice that do/end becomes delimiters. The second example would
2757-
then translate do:
2750+
Notice that `do/end` becomes delimiters. The second example would
2751+
then translate to:
27582752
27592753
if foo do
27602754
bar
@@ -3156,8 +3150,8 @@ defmodule Kernel do
31563150
end
31573151

31583152
@doc """
3159-
Returns true if the element on the left is equal (==) to
3160-
any of the items in the right.
3153+
Returns `true` if the element on the left is equal (==) to
3154+
any of the items on the right.
31613155
31623156
## Examples
31633157

0 commit comments

Comments
 (0)