From 3e56f6d329c38296fa0a2093c504b9900a80f68b Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Thu, 27 Apr 2017 05:08:10 -0700 Subject: [PATCH] Change focus in require explanation (#6041) --- lib/elixir/lib/kernel/special_forms.ex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/elixir/lib/kernel/special_forms.ex b/lib/elixir/lib/kernel/special_forms.ex index dd96ba89ca4..7a4cec67bae 100644 --- a/lib/elixir/lib/kernel/special_forms.ex +++ b/lib/elixir/lib/kernel/special_forms.ex @@ -507,13 +507,12 @@ defmodule Kernel.SpecialForms do defmacro alias(module, opts), do: error!([module, opts]) @doc """ - Requires a given module to be compiled and loaded. + Requires a module in order to use its macros. ## Examples - Notice that usually modules should not be required before usage, - the only exception is if you want to use the macros from a module. - In such cases, you need to explicitly require them. + Public functions in modules are globally available, but in order to use + macros, you need to opt-in by requiring the module they are defined in. Let's suppose you created your own `if/2` implementation in the module `MyMacros`. If you want to invoke it, you need to first explicitly