Skip to content

Commit f6058af

Browse files
committed
Misc. documentation cleanup
1 parent 67b5236 commit f6058af

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

lib/elixir/lib/kernel.ex

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ defmodule Kernel do
877877
It should not be used in application programs.
878878
879879
## Examples
880-
list_to_pid('<0.41>') #=> <0.4.1>
880+
list_to_pid('<0.4.1>') #=> #PID<0.4.1>
881881
"""
882882
@spec list_to_pid(char_list) :: pid
883883
def list_to_pid(char_list) do
@@ -905,7 +905,7 @@ defmodule Kernel do
905905
## Examples
906906
907907
make_ref()
908-
#=> #Ref<0.0.0.135>
908+
#=> #Reference<0.0.0.135>
909909
910910
"""
911911
@spec make_ref() :: reference
@@ -955,7 +955,7 @@ defmodule Kernel do
955955
end
956956

957957
@doc """
958-
Returns the node where the given argmuent is located.
958+
Returns the node where the given argument is located.
959959
The argument can be a pid, a reference, or a port.
960960
If the local node is not alive, nonode@nohost is returned.
961961
@@ -1008,7 +1008,7 @@ defmodule Kernel do
10081008

10091009
@doc """
10101010
Returns the size of the given argument, which must be a tuple
1011-
or a binary. If possible, please use tuple_size or binary_size.
1011+
or a binary. If possible, please use `tuple_size` or `binary_size`.
10121012
"""
10131013
@spec size(tuple|binary) :: non_neg_integer
10141014
def size(arg) do
@@ -1026,7 +1026,7 @@ defmodule Kernel do
10261026
current = Kernel.self
10271027
child = spawn(fn -> current <- { Kernel.self, 1 + 2 } end)
10281028
1029-
receive
1029+
receive do
10301030
{ ^child, 3 } -> IO.puts "Received 3 back"
10311031
end
10321032
@@ -1064,9 +1064,8 @@ defmodule Kernel do
10641064
current = Kernel.self
10651065
child = spawn_link(fn -> current <- { Kernel.self, 1 + 2 } end)
10661066
1067-
receive
1068-
{ ^child, 3 } ->
1069-
IO.puts "Received 3 back"
1067+
receive do
1068+
{ ^child, 3 } -> IO.puts "Received 3 back"
10701069
end
10711070
10721071
"""
@@ -1108,8 +1107,8 @@ defmodule Kernel do
11081107
@doc """
11091108
The same as `term_to_binary/1` but also supports two options:
11101109
1111-
* compressed: the level of compression to be used from 0 to 9;
1112-
* minor_version: used to control the details of encoding. Can be 0 or 1,
1110+
* `compressed`: the level of compression to be used from 0 to 9;
1111+
* `minor_version`: used to control the details of encoding. Can be 0 or 1,
11131112
please read http://www.erlang.org/doc/man/erlang.html#term_to_binary-2
11141113
for more details
11151114
@@ -1136,7 +1135,7 @@ defmodule Kernel do
11361135
end
11371136

11381137
@doc """
1139-
Returns an integer by the truncating the given number.
1138+
Returns an integer by truncating the given number.
11401139
Allowed in guard clauses.
11411140
11421141
## Examples
@@ -2003,7 +2002,7 @@ defmodule Kernel do
20032002
x * 2
20042003
end
20052004
2006-
Not only the example is shorter, it solves ambiguity issues. Since
2005+
Not only is the example shorter, it solves ambiguity issues. Since
20072006
`do/end` always matches the furthest call, if we used the `function`
20082007
macro as below:
20092008
@@ -2034,7 +2033,7 @@ defmodule Kernel do
20342033
The `function` macro can also be used to retrieve local or remote
20352034
functions:
20362035
2037-
f = function(:is_atom, 2)
2036+
f = function(:is_atom, 1)
20382037
f.(:foo) #=> true
20392038
20402039
f = function(List, :flatten, 1)

lib/elixir/lib/kernel/typespec.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ defmodule Kernel.Typespec do
7575
Elixir discourages the use of type `string()` as it might be confused
7676
with binaries which are referred to as "strings" in Elixir (as opposed to
7777
character lists). In order to use the type that is called `string()` in Erlang,
78-
one has to use the `char_list()` type which is a synonym to `string()`. If yu
78+
one has to use the `char_list()` type which is a synonym for `string()`. If you
7979
use `string()`, you'll get a warning from the compiler.
8080
8181
If you want to refer to the "string" type (the one operated by functions in the
@@ -704,4 +704,4 @@ defmodule Kernel.Typespec do
704704
defp variable({name, meta, _}) do
705705
{:var, line(meta), name}
706706
end
707-
end
707+
end

0 commit comments

Comments
 (0)