have module A.B. And another module A.C is the same. do not want to copy. is there a way to create GLOBAL pseudonym? smth like alias A.B as: A.C but not inside the module, site-wide.
the reason: i have some API as a requirement (incl module names) and already have a module with functional needed.
UPD: and yeah, actually modules are surface components, so i’ve failed when trying to use third module with all the stuff inside __using__ macro(((
If I got your question right, you are required to create a new module that follows the same public API as some other module that you already have. You also don’t want to copy code over from the existing module to the new one.
Have you looked at using defdelegate/2 (docs) to achieve what you’re looking for?
defdelegate/2 helps with functions, but not with module-level macros and use’d modules.
but thanks! this is much better than nothing.
maybe there is smth like moddelegate?
I wondered what the issue was, but after re-reading it seems there are duplicate module names and you want to ‘change the name’ of the external one. Right?
i want to create a module with new name (it’s requirement) but with all the functionality of the existing module (also internal) without code duplicating