@@ -44,10 +44,15 @@ defmodule IEx.Helpers do
4444 to write their object code to. It returns the name
4545 of the compiled modules.
4646
47+ When compiling one file, there is no need to wrap it in a list.
48+
4749 ## Examples
4850
49- c ["foo.ex"], "ebin"
50- #=> [Foo]
51+ c ["foo.ex", "bar.ex"], "ebin"
52+ #=> [Foo,Bar]
53+
54+ c "baz.ex"
55+ #=> [Baz]
5156
5257 """
5358 def c ( files , path // "." ) do
@@ -56,7 +61,8 @@ defmodule IEx.Helpers do
5661 end
5762
5863 @ doc """
59- Returns the name and module of all modules loaded.
64+ Prints the list of all loaded modules with paths to their corresponding .beam
65+ files.
6066 """
6167 def m do
6268 all = Enum . map :code . all_loaded , fn { mod , file } -> { inspect ( mod ) , file } end
@@ -70,7 +76,8 @@ defmodule IEx.Helpers do
7076 end
7177
7278 @ doc """
73- Prints commands history and their result.
79+ Prints the history of expressions evaluated during the session along with
80+ their results.
7481 """
7582 def v do
7683 history = Enum . reverse ( Process . get ( :iex_history ) )
@@ -82,14 +89,14 @@ defmodule IEx.Helpers do
8289 end
8390
8491 @ doc """
85- Shows the documentation for IEx.Helpers.
92+ Prints the documentation for IEx.Helpers.
8693 """
8794 def h ( ) do
8895 IEx.Introspection . h ( IEx.Helpers )
8996 end
9097
9198 @ doc """
92- Shows the documentation for the given module
99+ Prints the documentation for the given module
93100 or for the given function/arity pair.
94101
95102 ## Examples
@@ -136,8 +143,10 @@ defmodule IEx.Helpers do
136143 end
137144
138145 @ doc """
139- Prints all types for the given module or prints out a specified type's
140- specification
146+ When given a module, prints specifications (or simply specs) for all the
147+ types defined in it.
148+
149+ When given a particular type name, prints its spec.
141150
142151 ## Examples
143152
@@ -165,7 +174,11 @@ defmodule IEx.Helpers do
165174 end
166175
167176 @ doc """
168- Prints all specs from a given module.
177+ Similar to `t/1`, only for specs.
178+
179+ When given a module, prints the list of all specs defined in the module.
180+
181+ When given a particular spec name (with optional arity), prints its spec.
169182
170183 ## Examples
171184
@@ -207,9 +220,10 @@ defmodule IEx.Helpers do
207220 end
208221
209222 @ doc """
210- Retrieves nth query's value from the history. Use negative
211- values to lookup query's value from latest to earliest.
212- For instance, v(-1) returns the latest result.
223+ Retrieves nth expression's value from the history.
224+
225+ Use negative values to lookup expression values relative to the current one.
226+ For instance, v(-1) returns the result of the last evaluated expression.
213227 """
214228 def v ( n ) when n < 0 do
215229 history = Process . get ( :iex_history )
@@ -222,8 +236,8 @@ defmodule IEx.Helpers do
222236 end
223237
224238 @ doc """
225- Reloads all modules that were already reloaded
226- at some point with `r/1` .
239+ Reloads all modules that have already been reloaded with `r/1` at any point
240+ in the current IEx session .
227241 """
228242 def r do
229243 Enum . map iex_reloaded , r ( & 1 )
@@ -232,8 +246,8 @@ defmodule IEx.Helpers do
232246 @ doc """
233247 Recompiles and reloads the specified module's source file.
234248
235- Please note that all the modules defined in the specified
236- files are recompiled and reloaded.
249+ Please note that all the modules defined in the same file as `module`
250+ are recompiled and reloaded.
237251 """
238252 def r ( module ) do
239253 if source = source ( module ) do
@@ -245,15 +259,15 @@ defmodule IEx.Helpers do
245259 end
246260
247261 @ doc """
248- Purges and reloads specified module
262+ Purges and reloads specified module.
249263 """
250264 def l ( module ) do
251265 :code . purge ( module )
252266 :code . load_file ( module )
253267 end
254268
255269 @ doc """
256- Flushes all messages sent to the shell and prints them out
270+ Flushes all messages sent to the shell and prints them out.
257271 """
258272 def flush do
259273 receive do
@@ -297,7 +311,7 @@ defmodule IEx.Helpers do
297311 end
298312
299313 @ doc """
300- Changes the shell directory to the given path.
314+ Changes the current working directory to the given path.
301315 """
302316 def cd ( directory ) do
303317 case File . cd ( expand_home ( directory ) ) do
0 commit comments