Hi Isaiah,

thanks for pointing that out, that must be the case here,

andrea



On Monday, 20 January 2014 19:42:54 UTC, Isaiah wrote:
>
> I think this is a known issue with comprehensions. The type inference 
> machinery
> can't quite verify that everything is stable (yet), see:
> https://github.com/JuliaLang/julia/issues/524
>
> and especially:
>
> https://github.com/JuliaLang/julia/issues/524#issuecomment-4356344
>
> (as well as the other issues linked therein)
>
>
> On Mon, Jan 20, 2014 at 2:29 PM, Andrea Vigliotti 
> <[email protected]<javascript:>
> > wrote:
>
>> Hi all,
>>
>> I would just like to ask a question about the type of array constructed 
>> via inner for loops, in the following:
>>
>> julia> dummy = randn(10);
>>
>> julia> typeof(dummy)
>> Array{Float64,1}
>>
>> julia> typeof([dummy[kk] < 0.0 ? float64(0.0) : float(dummy[kk]) for kk =
>> 1:10])
>> Array{Any,1}
>>
>> julia> typeof(float64([dummy[kk] < 0.0 ? float64(0.0) : dummy[kk] for kk 
>> =1:10]))
>> Array{Float64,1}
>>
>>
>>  why the second array has type Any (unless I force it to be float64 as in 
>> the third case), even if all elements are float64 ? But: 
>>
>> julia> typeof([float64(kk) for kk = 1:10])
>> Array{Float64,1}
>>
>> many thanks in advance
>>
>> andrea
>>
>
>

Reply via email to