Specify arity using only or except when importing function on Elixir
问题 I'm studying Elixir and when I use only or except operators when importing functions from a module I need to specify an arity number. Why? e.g. import :math, only: [sqrt: 1] or import :math, except: [sin: 1, cos: 1] 回答1: Across the Erlang ecosystem functions are identified by name + arity. In most other languages you can overload functions by name. In other words, in the Erlang world foo/1 (that is, foo(one_arg)) is a completely different function than foo/2 (as in, foo(one_arg, two_arg)),