Skip to content

Commit a05592f

Browse files
author
José Valim
committed
Only accept the IO device on inspect when we have three args
1 parent 3147df8 commit a05592f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/elixir/lib/io.ex

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,21 @@ defmodule IO do
127127

128128
@doc """
129129
Inspects and writes the given argument to the device
130-
followed by a new line. Returns the item given.
130+
followed by a new line. A set of options can be given.
131+
132+
## Examples
133+
134+
IO.inspect Process.list
135+
136+
"""
137+
def inspect(item, opts // []) do
138+
inspect group_leader(), item, opts
139+
end
140+
141+
@doc """
142+
Inspects the item with options using the given device.
131143
"""
132-
def inspect(device // group_leader(), item, opts // []) do
144+
def inspect(device, item, opts) do
133145
puts device, Binary.Inspect.inspect(item, opts)
134146
item
135147
end

0 commit comments

Comments
 (0)