File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -371,18 +371,21 @@ defmodule IEx do
371
371
the process information. Let's see an example:
372
372
373
373
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
378
381
end
379
382
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
381
384
your shell to pry the given environment. By allowing it,
382
385
the shell will be reset and you gain access to all variables
383
386
and the lexical scope from above:
384
387
385
- iex (1)> map([a,b,c], &IO.inspect(&1))
388
+ pry (1)> map([a,b,c], &IO.inspect(&1))
386
389
1
387
390
2
388
391
3
@@ -392,7 +395,7 @@ defmodule IEx do
392
395
process can be freed by calling `respawn`, which starts a
393
396
new IEx evaluation cycle, letting this one go:
394
397
395
- iex (2)> respawn
398
+ pry (2)> respawn
396
399
true
397
400
398
401
Interactive Elixir - press Ctrl+C to exit (type h() ENTER for help)
You can’t perform that action at this time.
0 commit comments