Skip to content

Commit db25e24

Browse files
author
José Valim
committed
Merge pull request #2390 from benjamintanweihao/patch-3
Update IEx.pry documentation
2 parents fcd6213 + 8a184a6 commit db25e24

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lib/iex/lib/iex.ex

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,18 +371,21 @@ defmodule IEx do
371371
the process information. Let's see an example:
372372
373373
import Enum, only: [map: 2]
374-
375-
def add(a, b) do
376-
c = a + b
377-
IEx.pry
374+
require IEx
375+
376+
defmodule Adder do
377+
def add(a, b) do
378+
c = a + b
379+
IEx.pry
380+
end
378381
end
379382
380-
When invoking `add(1, 2)`, you will receive a message in
383+
When invoking `Adder.add(1, 2)`, you will receive a message in
381384
your shell to pry the given environment. By allowing it,
382385
the shell will be reset and you gain access to all variables
383386
and the lexical scope from above:
384387
385-
iex(1)> map([a,b,c], &IO.inspect(&1))
388+
pry(1)> map([a,b,c], &IO.inspect(&1))
386389
1
387390
2
388391
3
@@ -392,7 +395,7 @@ defmodule IEx do
392395
process can be freed by calling `respawn`, which starts a
393396
new IEx evaluation cycle, letting this one go:
394397
395-
iex(2)> respawn
398+
pry(2)> respawn
396399
true
397400
398401
Interactive Elixir - press Ctrl+C to exit (type h() ENTER for help)

0 commit comments

Comments
 (0)