Skip to content

Commit 95bea1a

Browse files
author
José Valim
committed
Fix delegations in Process.ex
1 parent 85fce7a commit 95bea1a

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

lib/elixir/lib/process.ex

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,19 @@ defmodule Process do
103103

104104
@doc """
105105
Returns the pid of a new process started by the application of `fun`.
106+
It behaves exactly the same as `Kernel.spawn/1`.
107+
"""
108+
def spawn(fun) do
109+
:erlang.spawn(fun)
110+
end
106111

107-
It behaves exactly the same as the `Kernel.spawn/1` function except
108-
it also accepts extra options, for the list of available options
109-
check http://www.erlang.org/doc/man/erlang.html#spawn_opt-4
112+
@doc """
113+
Returns the pid of a new process started by the application of `fun`.
114+
115+
It also accepts extra options, for the list of available options
116+
check http://www.erlang.org/doc/man/erlang.html#spawn_opt-2
110117
"""
111-
def spawn(fun, opts // []) do
118+
def spawn(fun, opts) do
112119
:erlang.spawn_opt(fun, opts)
113120
end
114121

@@ -117,12 +124,22 @@ defmodule Process do
117124
`module.function(args)`. The new process created will be placed in the system
118125
scheduler queue and be run some time later.
119126
120-
It behaves exactly the same as the `Kernel.spawn/3` function except
121-
it also accepts extra options, for the list of available options
127+
It behaves exactly the same as the `Kernel.spawn/3` function.
128+
"""
129+
def spawn(mod, fun, args) do
130+
:erlang.spawn(mod, fun, args)
131+
end
132+
133+
@doc """
134+
Returns the pid of a new process started by the application of
135+
`module.function(args)`. The new process created will be placed in the system
136+
scheduler queue and be run some time later.
137+
138+
It also accepts extra options, for the list of available options
122139
check http://www.erlang.org/doc/man/erlang.html#spawn_opt-4
123140
124141
"""
125-
def spawn(mod, fun, args, opts // []) do
142+
def spawn(mod, fun, args, opts) do
126143
:erlang.spawn_opt(mod, fun, args, opts)
127144
end
128145

0 commit comments

Comments
 (0)