Call external module funcs inside generated functions in macro

You forgot unquote

quote do
  def test_inside_use_sample() do
    unquote(custom_guard.test())
    # or like this
    unquote(custom_guard),test()
  end
end


Try using higher order functions