When I get libraries with the using
keyword I get warnings in the console on startup. How can I mitigate the problem of name clashes? I don't see library alias keyword as
which is available in other programming languages.
Asked
Active
Viewed 764 times
6

m33lky
- 7,055
- 9
- 41
- 48
-
You can use `import` instead. – Chris Rackauckas Apr 24 '17 at 07:49
-
Can I `use` part of the whole package? – m33lky Apr 24 '17 at 07:51
-
For reference, which libraries? – Chris Rackauckas Apr 24 '17 at 07:58
-
1see [my answer to this question](http://stackoverflow.com/a/39566646/4183191) it covers all the important issues related to your question. – Tasos Papastylianou Apr 24 '17 at 08:31
1 Answers
9
You can use import
instead. You can always alias it yourself since modules are just variables:
import DifferentialEquations
DiffEq = DifferentialEquations
const DE = DifferentialEquations # Don't know if const matters here
There's an open issue for providing import as
syntactic sugar for this. https://github.com/JuliaLang/julia/issues/1255

Chris Rackauckas
- 18,645
- 3
- 50
- 81
-
You should always do `const`! If not then `DiffEq.foo`, and any calls to it, will never be inferable. – Fengyang Wang Apr 24 '17 at 21:09
-
Wasn't sure if modules had an implicit const or something in it. – Chris Rackauckas Apr 24 '17 at 22:00