将功能委托给另一个模块

使用 defdelegate 定义委托给另一个模块中定义的同名函数的函数:

defmodule Math do
  defdelegate pi, to: :math
end

iex> Math.pi
3.141592653589793