Create function on-the-fly?

here is simpler one :

iex(40)> expr = quote do: ProdSys.rule({ :test, 3,5 })
 {{:., [], [{:__aliases__, [alias: false], [:ProdSys]}, :rule]}, [],
  [{:{}, [], [:test, 3, 5]}]}

iex(41)> res = Macro.expand_once(expr, __ENV__)                          
 {:def, [context: ProdSys, import: Kernel],
 [{:{}, [context: ProdSys], [{[], [:test, 3, 5]}]}, [do: true]]}

iex(42)> IO.puts Macro.to_string(res)                 
  def({{[], [:test, 3, 5]}}) do
   true
 end