Elixir has four ways to access functionality from other modules
This allows us to the short version especially for nested name spaces.
alias MyApp.Accounts.User let us use just
User rather than the full
It also allows us to define our own short names. e.g.
alias MyApp.LattitudeAndLongitude as latlong
python supports the second use case via
import module as shortname syntax
Import functionality from other modules. This is similar to python's
from module import syntax.
In python, if you want to import a few functions, you use
from module import func1, func2 etc. But if you want to use most but not all functions, you
end up with a long
except options to make such importing easier.
use adds the functionality from other modules into the current one.
func2 became available to
python does not have similar functionality.
This is similar to
use except for macros. It makes a macro from an external
module available to the compiler at compile time.