Both `import` and `use` will do the require for you.

See: http://elixir-lang.org/getting-started/alias-require-and-import.html

Until I read this, I also didn't understand why I didn't need to use
require everywhere.
Allen Madsen
http://www.allenmadsen.com


On Tue, Sep 13, 2016 at 9:02 AM, Louis Pilfold <[email protected]> wrote:
> Functions do not need to be required, only macros :)
>
> Cheers,
> Louis
>
> On 13 September 2016 at 13:54, eksperimental
> <[email protected]> wrote:
>> Thank you José for your answer,
>> so why is so I don't need to require IO and Enum?
>>
>> $ elixir -e "IO.inspect(Enum.at(1..5, 2))"
>> 3
>>
>>
>> On Tue, 13 Sep 2016 08:39:24 +0200
>> José Valim <[email protected]> wrote:
>>
>>> You always need to require a module before using it. The only exception is
>>> the Kernel module.
>>>
>>>
>>>
>>> *José Valim*
>>> www.plataformatec.com.br
>>> Skype: jv.ptec
>>> Founder and Director of R&D
>>>
>>> On Tue, Sep 13, 2016 at 6:40 AM, eksperimental <[email protected]>
>>> wrote:
>>>
>>> > I'm hacking Elixir core, and I haven't managed to find the code that makes
>>> > some modules not to be
>>> > required in order to use them. Same as it happens with Enum for example.
>>> >
>>> > Can anybody guide me in what's the procedure to achive this? since I'm
>>> > trying to avoid "require
>>> > NewModule" from a macro I'm working on.
>>> >
>>> > Thank you
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google Groups
>>> > "elixir-lang-core" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send an
>>> > email to [email protected].
>>> > To view this discussion on the web visit https://groups.google.com/d/
>>> > msgid/elixir-lang-core/20160913114058.0f10b282.
>>> > eksperimental%40autistici.org.
>>> > For more options, visit https://groups.google.com/d/optout.
>>> >
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elixir-lang-core/20160913195458.31cf0f06.eksperimental%40autistici.org.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elixir-lang-core/CAM-pwt6Qh340ATYosvrNt%3DWNLCz36dyWYHer9m5dpkbxYS_gpg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAK-y3CubH98NVNkhtfYsVZN9qtZndFR1CwL%2BDiP1XCrDpxeS4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to