Hi Rich!
To clarify, the current behaviour is documented.
It is also worth noting that passing an empty :only is the only mechanism
for you to fully unimport a module:
# It was imported it, but we don't want it
import SomeModule, only: []
Therefore if we change it to what you propose, the above no longer works.
There are also some advantages for not "merging" imports, as proposed, as
merging means one would need to look up at many difference places to find
what is actually imported.
In any case, regardless if you agree or disagree with the current rules,
changing its behaviour would be a strong backwards incompatible change.
*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D
On Sat, May 18, 2019 at 9:40 PM Rich Morin <[email protected]> wrote:
> On occasion, I want to use multiple import statements for the same module,
> eg:
>
> # import Common, only: [ ii: 2 ] # uncomment for debugging
> import Common, only: [ str_list: 1 ]
>
> By way of explanation, Common.ii/2 is a tracing routine which is mostly
> used
> for debugging. So, I want it to be available when I need it, but not
> generate
> compiler warnings when it's not being used. For details, see:
>
>
> https://elixirforum.com/t/enabling-access-to-occasionally-used-eg-tracing-functions/22517
>
> Unfortunately, when I tried the approach above, I found that only the last
> import
> took effect; the first one was silently ignored (!). Could import be
> extended to
> allow multiple imports of the same module?
>
> -r
>
> --
> 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/45C899A6-9830-422E-8968-AE9E50D06B49%40gmail.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/CAGnRm4KphGb6LMWeW0p-4QGLzPPEAHxfZWBccfNGNvjPZCZdnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.