@@ -217,42 +217,9 @@ defmodule IEx.Helpers do
217217 iex> h Enum.all?
218218
219219 """
220- @ h_modules [ __MODULE__ , Kernel , Kernel.SpecialForms ]
221-
222- defmacro h ( term )
223- defmacro h ( { :/ , _ , [ call , arity ] } = term ) do
224- args =
225- case Macro . decompose_call ( call ) do
226- { _mod , :__info__ , [ ] } when arity == 1 ->
227- [ Module , :__info__ , 1 ]
228- { mod , fun , [ ] } ->
229- [ mod , fun , arity ]
230- { fun , [ ] } ->
231- [ @ h_modules , fun , arity ]
232- _ ->
233- [ term ]
234- end
235-
236- quote do
237- IEx.Introspection . h ( unquote_splicing ( args ) )
238- end
239- end
240-
241- defmacro h ( call ) do
242- args =
243- case Macro . decompose_call ( call ) do
244- { _mod , :__info__ , [ ] } ->
245- [ Module , :__info__ , 1 ]
246- { mod , fun , [ ] } ->
247- [ mod , fun ]
248- { fun , [ ] } ->
249- [ @ h_modules , fun ]
250- _ ->
251- [ call ]
252- end
253-
220+ defmacro h ( term ) do
254221 quote do
255- IEx.Introspection . h ( unquote_splicing ( args ) )
222+ IEx.Introspection . h ( unquote ( IEx.Introspection . decompose ( term ) ) )
256223 end
257224 end
258225
@@ -268,22 +235,9 @@ defmodule IEx.Helpers do
268235 iex> b(Mix.Task.run)
269236 iex> b(GenServer)
270237 """
271- defmacro b ( term )
272- defmacro b ( { :/ , _ , [ { { :. , _ , [ mod , fun ] } , _ , [ ] } , arity ] } ) do
273- quote do
274- IEx.Introspection . b ( unquote ( mod ) , unquote ( fun ) , unquote ( arity ) )
275- end
276- end
277-
278- defmacro b ( { { :. , _ , [ mod , fun ] } , _ , [ ] } ) do
279- quote do
280- IEx.Introspection . b ( unquote ( mod ) , unquote ( fun ) )
281- end
282- end
283-
284- defmacro b ( module ) do
238+ defmacro b ( term ) do
285239 quote do
286- IEx.Introspection . b ( unquote ( module ) )
240+ IEx.Introspection . b ( unquote ( IEx.Introspection . decompose ( term ) ) )
287241 end
288242 end
289243
@@ -305,22 +259,9 @@ defmodule IEx.Helpers do
305259 @type t() :: Enumerable.t()
306260
307261 """
308- defmacro t ( term )
309- defmacro t ( { :/ , _ , [ { { :. , _ , [ mod , fun ] } , _ , [ ] } , arity ] } ) do
262+ defmacro t ( term ) do
310263 quote do
311- IEx.Introspection . t ( unquote ( mod ) , unquote ( fun ) , unquote ( arity ) )
312- end
313- end
314-
315- defmacro t ( { { :. , _ , [ mod , fun ] } , _ , [ ] } ) do
316- quote do
317- IEx.Introspection . t ( unquote ( mod ) , unquote ( fun ) )
318- end
319- end
320-
321- defmacro t ( module ) do
322- quote do
323- IEx.Introspection . t ( unquote ( module ) )
264+ IEx.Introspection . t ( unquote ( IEx.Introspection . decompose ( term ) ) )
324265 end
325266 end
326267
@@ -336,30 +277,9 @@ defmodule IEx.Helpers do
336277 iex> s(is_atom/1)
337278
338279 """
339- defmacro s ( term )
340- defmacro s ( { :/ , _ , [ call , arity ] } = term ) do
341- args =
342- case Macro . decompose_call ( call ) do
343- { mod , fun , [ ] } -> [ mod , fun , arity ]
344- { fun , [ ] } -> [ Kernel , fun , arity ]
345- _ -> [ term ]
346- end
347-
348- quote do
349- IEx.Introspection . s ( unquote_splicing ( args ) )
350- end
351- end
352-
353- defmacro s ( call ) do
354- args =
355- case Macro . decompose_call ( call ) do
356- { mod , fun , [ ] } -> [ mod , fun ]
357- { fun , [ ] } -> [ Kernel , fun ]
358- _ -> [ call ]
359- end
360-
280+ defmacro s ( term ) do
361281 quote do
362- IEx.Introspection . s ( unquote_splicing ( args ) )
282+ IEx.Introspection . s ( unquote ( IEx.Introspection . decompose ( term ) ) )
363283 end
364284 end
365285
0 commit comments