Corner.Rename (corner v0.1.3)

Define macro rename/2.

Link to this section Summary

Functions

rename/2 is used to rename function in a module a new name.

Link to this section Functions

Link to this macro

rename(fun, list)

(macro)

rename/2 is used to rename function in a module a new name.

rename suport two format:

  1. give function arity as: reanme ModuleName.fun_name/2, to: new_fun_name.
  2. 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