I’m not really sure how this is related to macros at all. You have two different functions named the same in the same scope. That’s not going to work well. The compiler cannot decide for you which of the two ones it’s supposed to call. How those named functions ended up in the same scope shouldn’t make any difference.
This is related to macros because it relates to injecting definitions in a scope where the same definition already exists.
This is breaking macro hygiene: more specifically, if injecting a variable is not a problem, then injecting a definition should not be a problem too. (See macro hygiene).
:only and :except options are available for import, you can use them to steer the compiler in the right direction.
But if you want hygiene for macro defined functions as you have them for variables, fine. You made macros useless, as from now on funtions defined in a macro don’t leak the macro anymore!
But if you want hygiene for macro defined functions as you have them for variables, fine. You made macros useless, as from now on funtions defined in a macro don’t leak the macro anymore!
I was almost going to agree with this, but then I remembered that the injected functions are accessible through the AModule interface. So macros do not become useless.
When you are in AModule, there is no difference between bar and AModule.bar.
Just cope with it. Calling a macro is the same as copy and pasting code into your file. If you do not want a function f generated, then do not call the macro.
If you do not want to import a function g, then :exclude it from the import list.
That aside, I have a very strict opinion about libraries narrowing my own available namespace by dumping arbitrary functions into my module. But I think we already argued about this a lot in the slack…