Corner.Rename (corner v0.1.2)
Define macro rename/2
.
Link to this section Summary
Link to this section Functions
rename/2
is used to rename function in a module a new name.
rename
suport two format:
- give function arity as:
reanme ModuleName.fun_name/2, to: new_fun_name
. - not give the function arity, as:
rename ModuleName.fun_name, to: new_fun_name
.
example
Example
iex> defmodule M do
...> import Corner.Rename, only: [rename: 2]
...> rename String.length, to: str_len
...> rename String.at/2, to: str_at
...> def test() do
...> str = "Hello"
...> str_len(str) == String.length(str)
...> and String.at(str,1) === str_at(str,1)
...> end
...> end
iex> M.test()
true