The first call is executed in Main since the DataFrames module hasn't started yet. The second loads names so that DataFrames can use those functions internally.
This is not a pattern I'd encourage since it doesn't load names into the caller's namespace: it always loads them into Main. -- John > On Mar 28, 2014, at 5:42 AM, RecentConvert <giz...@gmail.com> wrote: > > What is the scope of a module loaded within another module? I ask because > while I was examining the workings of the DataFrames module I noticed it had > duplicate calls of the Stats module. > > DataFrames.jl > # Note that the two calls to using Stats in this file are > # strictly required: one pulls the names into DataFrames > # for easy access within the module, whereas the other call > # pushes those names into Main. > using Stats > using DataArrays > > > module DataFrames > > > > ############################################################################## > ## > ## Dependencies > ## > > ############################################################################## > > > using Base.Intrinsics > using DataArrays > using GZip > using Stats > using SortingAlgorithms > > How do these two calls to Stats differ in scope?