One option is to explicitly import the DataArrays package.
This should probably be filed as a bug against the Reexport.jl package used
by DataFrames:
https://github.com/simonster/Reexport.jl/issues


On Wed, May 14, 2014 at 8:23 AM, David Gonzales <dvdgonzale...@gmail.com>wrote:

> the dump from the REPL was a bit buggy, here is a fixup:
>
> julia> TestUsing.testisna1()
> ERROR: isna not defined
>  in testisna1 at TestUsing.jl:6
>
> julia> TestUsing.testisna2()
> ERROR: DataArrays not defined
>  in testisna2 at TestUsing.jl:10
>
> julia> TestUsing.testisna3()
> false
>
>
>
>
>
> On Wednesday, May 14, 2014 3:14:12 PM UTC+3, David Gonzales wrote:
>>
>> When converting my script into a Module, some problems cropped up
>> accessing the isna(...) function from DataArrays.
>>
>> I managed to reduce the problem into a namespace resolution problem:
>> When using a Module inside a Module definition, the recursivity of name
>> search is not working.
>> In the example below: isna(...) from DataArrays is not available to
>> TestUsing after it issued a "using DataFrames".
>>
>> The question is: Is this the behaviour we would/should want?
>>
>> This is a simple demonstration of the issue:
>>
>> module TestUsing
>>
>> using DataFrames
>>
>> function testisna1()
>>     isna(100)
>> end
>> function testisna2()
>>     DataArrays.isna(100)
>> end
>> function testisna3()
>>     DataFrames.DataArrays.isna(100)
>> end
>> end # Module TestUsing
>>
>> and the interaction from the REPL:
>>
>>    _       _ _(_)_     |  A fresh approach to technical computing
>>   (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
>>    _ _   _| |_  __ _   |  Type "help()" to list help topics
>>   | | | | | | |/ _' |  |
>>   | | |_| | | | (_| |  |  Version 0.3.0-prerelease+2918 (2014-05-06 22:29
>> UTC)
>>  _/ |\__'_|_|_|\__'_|  |  Commit 104568c (7 days old master)
>> |__/                   |  i686-linux-gnu
>>
>> julia>
>> julia> using TestUsing
>> Warning: New definition
>>     isequal(NAtype,Any) at /home/dan/.julia/v0.3/
>> DataArrays/src/operators.jl:556
>> is ambiguous with:
>>     isequal(Any,WeakRef) at base.jl:114.
>> To fix, define
>>     isequal(NAtype,WeakRef)
>> before the new definition.
>> Warning: New definition
>>     isequal(Any,NAtype) at /home/dan/.julia/v0.3/
>> DataArrays/src/operators.jl:557
>> is ambiguous with:
>>     isequal(WeakRef,Any) at base.jl:113.
>> To fix, define
>>     isequal(WeakRef,NAtype)
>> before the new definition.
>> Warning: ignoring conflicting import of StatsBase.range into DataFrames
>>
>> julia> TestUsing.testisna()
>> ERROR: testisna not defined
>>
>> julia> TestUsing.testisna2()
>> ERROR: DataArrays not defined
>>  in testisna2 at /home/dan/projects/julia-housing/TestUsing.jl:10
>>
>> julia> TestUsing.testisna3()
>> false
>>
>>
>>

Reply via email to