yeah, i think it may be explained somewhere in these:
https://github.com/JuliaLang/julia/pull/1436
https://groups.google.com/forum/#!msg/julia-dev/IJkh1sUXq1A/GaLLQgQxu6kJ
https://github.com/JuliaLang/julia/issues/947
the last mentions type widening.
i need to go out, but perhaps that helps...
good luck,
andrew
On Saturday, 29 March 2014 11:46:12 UTC-3, andrew cooke wrote:
>
>
> huh, well, i see exactly the same weird behaviour you do. i have no idea
> why. hopefully someone who knows more will be attracted by the noise :o)
>
> one clue, perhaps, is that
>
> julia> test = [ randBinStr(3) for i=1:0 ]
> 0-element Array{Union(ASCIIString,UTF8String),1}
>
> gives the type. i would have expected that to say
> 0-element Array{None,1}
> but it appears that there is some strange kind of type-inference
> happening?!
>
> andrew
>
>
> On Saturday, 29 March 2014 11:08:52 UTC-3, Andrew Dabrowski wrote:
>>
>> Not at all sure this is the right way to do it...
>>
>> function randBinStr( len::Int )
>> res = repeat( "0", len )
>> replace( res, r"(.)", x -> ( rand() < 0.5 ? "0" : "1" ) )
>> end
>>
>>
>>
>> On Saturday, March 29, 2014 9:49:59 AM UTC-4, andrew cooke wrote:
>>>
>>> can you post randBinStr? don't have an explanation, just curious. the
>>> following seems fine:
>>>
>>>