From 2aee6bdf2dff13748af465e53dd13ba67f2db348 Mon Sep 17 00:00:00 2001 From: Yurii Rashkovskii Date: Fri, 30 Nov 2012 01:53:05 -0800 Subject: [PATCH] Add support for h(function_name) helper in IEx Allows printing documentation for IEx helpers and Kernel's functions/macros without specifying arity. --- lib/iex/lib/iex/helpers.ex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/iex/lib/iex/helpers.ex b/lib/iex/lib/iex/helpers.ex index d1d09698bb..5d8fa9dee9 100644 --- a/lib/iex/lib/iex/helpers.ex +++ b/lib/iex/lib/iex/helpers.ex @@ -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), [])