Add support for h(function_name) helper in IEx

Allows printing documentation for IEx helpers and Kernel's functions/macros without specifying arity.
This commit is contained in:
Yurii Rashkovskii
2012-11-30 01:53:05 -08:00
parent 51f2530f79
commit 2aee6bdf2d
+7
View File
@@ -117,6 +117,13 @@ defmodule IEx.Helpers do
end
end
defmacro h({ name, _, args }) when args in [nil, []] do
quote do
h(unquote(__MODULE__), unquote(name))
h(Kernel, unquote(name))
end
end
defmacro h(other) do
quote do
h(unquote(other), [])