IEx.Helpers.import_if_available
You're seeing just the macro
import_if_available
, go back to IEx.Helpers module for more information.
Calls import/2
with the given arguments, but only if the module is available.
This lets you put imports in .iex.exs
files (including ~/.iex.exs
) without
getting compile errors if you open a console where the module is not available.
Example
# In ~/.iex.exs
import_if_available(Ecto.Query)