How do one avoid re-importing (dont want to use using dep_package_1
more than once)
a dependency in case of creating a sub-package:
situation in detail as follows:
module mypackage
using dep_package_1 # dependency
# some code inlcuded using functions in dep_package 1
module my_subpackage
using dep_package _1 # do not wish to do this again here
# some more code, under my_subpackage 1
end
end
First, why you do not want to add using dep_package_1
?
However, if you do not want to do this twice, you can reexport everything of dep_package_1
in my_subpackage
and then add using my_subpackage
to mypackage
.
It may sound silly now, but i was thinking about not writing redundant lines first.
So, if i keep the code as it is, it wouldn’t cause any performance issues ,right?
I mean using Pkg_name
second time is infact more efficient/effortless compared to the first-time in julia if i am not wrong !(?)
No, it’s not. The second time will be almost instantaneous.