File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ defmodule IEx.Helpers do
66 more joyful to work with.
77
88 This message was triggered by invoking the helper
9- `h()`, usually referred as `h/0` (since it expects 0
9+ `h()`, usually referred to as `h/0` (since it expects 0
1010 arguments).
1111
1212 There are many other helpers available:
@@ -37,6 +37,36 @@ defmodule IEx.Helpers do
3737 h(Enum)
3838 h(Enum.reverse/1)
3939
40+
41+ ## A note about expressions in IEx ##
42+
43+ IEx treats incomplete expressions in a special way, allowing one
44+ to spill an expression over multiple lines. For example,
45+
46+ iex(1)> "ab
47+ ...(1)> c"
48+ "ab\n c"
49+
50+ In the example above, the shell will be expecting more input until it finds
51+ the closing quote. Sometimes it is not obvious which character the shell is
52+ expecting, and the user may find themselves trapped in the state of
53+ incomplete expression with no ability to terminate it other than by exiting
54+ the shell.
55+
56+ For such cases, there is a special break-trigger ("#!break") that when
57+ encountered on a line by itself will force the shell to break out of any
58+ pending expression and return to its normal state:
59+
60+ iex(1)> ["ab
61+ ...(1)> c"
62+ ...(1)> "
63+ ...(1)> ]
64+ ...(1)> #!break
65+ ** (TokenMissingError) iex:1: incomplete expression
66+ ...
67+
68+ iex(1)>
69+
4070 """
4171
4272 @ doc """
You can’t perform that action at this time.
0 commit comments