On Sat, 2014-03-15 at 13:32, moham...@computer.org wrote:
> I would like to know what is the difference between "import" and "using"?
> When is it advantageous to use either of them?

https://groups.google.com/d/msg/julia-users/xbsdu8Ob4cw/FcJyBZQYfIwJ

there Kevin says:

Briefly:
1. "using MyModule" imports all of the exported functions of MyModule into the 
current namespace
2. "import MyModule" imports the module name; functions can be called with 
"MyModule.fn(x,y)"
3. "import MyModule: fn1, fn2" imports the functions "fn1" and "fn2" into the 
current namespace
4. "require("somefile.jl")" loads a particular file.  This is useful when:

  a. you have a script or some bare function definitions you wish to 
load/execute from another file or at the REPL
  b. a file defines a module with a different name than the filename (as in my 
answer to #1 above)


> On Mar 15, 2014 3:18 PM, "Steven G. Johnson" <stevenj....@gmail.com> wrote:
>
>>
>>
>> On Friday, March 14, 2014 2:33:27 PM UTC-4, Ivar Nesje wrote:
>>>
>>> I think you should be able to use the fully qualified name
>>>
>>> Winston.plot(...)
>>>>
>>>>
>>>>
>> Note also that if are intending to access the functions via the fully
>> qualified names you should do
>>
>>      import Winston
>>
>> instead of "using Winston"
>>
>> You can also define a shortcut via e.g.
>>
>>      import Winston
>>      const W = Winston
>>      W.plot(....)
>>

Reply via email to