<p dir="auto">Julia Version: 1.1.0</p>
<p dir="auto"><code class="notranslate">rand(10)</code> returns a 10-element Array{Float64, 1}.<br>
<code class="notranslate">rand.(10)</code> returns the same thing, but of course with different numbers.</p>
<p dir="auto"><code class="notranslate">rand(10) .&lt; 0.3</code> works, returning a 10-element BitArray{1}.<br>
<code class="notranslate">rand.(10) .&lt; 0.3</code> screams:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; rand.(10) .&lt; 0.3
ERROR: MethodError: no method matching isless(::Array{Float64,1}, ::Float64)
Closest candidates are:
  isless(::Float64, ::Float64) at float.jl:459
  isless(::Missing, ::Any) at missing.jl:70
  isless(::AbstractFloat, ::AbstractFloat) at operators.jl:148
  ...
Stacktrace:
 [1] &lt;(::Array{Float64,1}, ::Float64) at .\operators.jl:260
 [2] _broadcast_getindex at .\broadcast.jl:578 [inlined]
 [3] getindex at .\broadcast.jl:511 [inlined]
 [4] copy at .\broadcast.jl:763 [inlined]
 [5] materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Nothing,typeof(&lt;),Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Nothing,typeof(rand),Tuple{Int64}},Float64}}) at .\broadcast.jl:753
 [6] top-level scope at none:0"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">rand</span>.(<span class="pl-c1">10</span>) <span class="pl-k">.&lt;</span> <span class="pl-c1">0.3</span>
ERROR<span class="pl-k">:</span> MethodError<span class="pl-k">:</span> no method matching <span class="pl-c1">isless</span>(<span class="pl-k">::</span><span class="pl-c1">Array{Float64,1}</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>)
Closest candidates are<span class="pl-k">:</span>
  <span class="pl-c1">isless</span>(<span class="pl-k">::</span><span class="pl-c1">Float64</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>) at float<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">459</span>
  <span class="pl-c1">isless</span>(<span class="pl-k">::</span><span class="pl-c1">Missing</span>, <span class="pl-k">::</span><span class="pl-c1">Any</span>) at <span class="pl-c1">missing</span><span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">70</span>
  <span class="pl-c1">isless</span>(<span class="pl-k">::</span><span class="pl-c1">AbstractFloat</span>, <span class="pl-k">::</span><span class="pl-c1">AbstractFloat</span>) at operators<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">148</span>
  <span class="pl-k">...</span>
Stacktrace<span class="pl-k">:</span>
 [<span class="pl-c1">1</span>] <span class="pl-k">&lt;</span>(<span class="pl-k">::</span><span class="pl-c1">Array{Float64,1}</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>) at <span class="pl-k">.\</span>operators<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">260</span>
 [<span class="pl-c1">2</span>] _broadcast_getindex at <span class="pl-k">.\</span>broadcast<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">578</span> [inlined]
 [<span class="pl-c1">3</span>] getindex at <span class="pl-k">.\</span>broadcast<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">511</span> [inlined]
 [<span class="pl-c1">4</span>] copy at <span class="pl-k">.\</span>broadcast<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">763</span> [inlined]
 [<span class="pl-c1">5</span>] <span class="pl-c1">materialize</span>(<span class="pl-k">::</span><span class="pl-c1">Base.Broadcast.Broadcasted</span>{Base<span class="pl-k">.</span>Broadcast<span class="pl-k">.</span>DefaultArrayStyle{<span class="pl-c1">0</span>},Nothing,<span class="pl-c1">typeof</span>(<span class="pl-k">&lt;</span>),Tuple{Base<span class="pl-k">.</span>Broadcast<span class="pl-k">.</span>Broadcasted{Base<span class="pl-k">.</span>Broadcast<span class="pl-k">.</span>DefaultArrayStyle{<span class="pl-c1">0</span>},Nothing,<span class="pl-c1">typeof</span>(rand),Tuple{Int64}},Float64}}) at <span class="pl-k">.\</span>broadcast<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">753</span>
 [<span class="pl-c1">6</span>] top<span class="pl-k">-</span>level scope at none<span class="pl-k">:</span><span class="pl-c1">0</span></pre></div>
<p dir="auto">It doesn't seem right.</p>
<p dir="auto">I encountered the issue on a more complex line, where I had been using <code class="notranslate">@.</code> at the beginning for convenience. It also does not work like that either.</p>
<p dir="auto">Following the discussion in <a href="https://github.com/JuliaLang/julia/issues/24595" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/24595/hovercard">this issue</a> an Array is constructed as</p>
<p dir="auto"><code class="notranslate">Array{T}(undef, shape...)</code></p>
<p dir="auto">A <code class="notranslate">SharedArray</code> however is still constructed using</p>
<p dir="auto"><code class="notranslate">SharedArray{T}(shape...)</code></p>
<p dir="auto">Having asked about this <a href="https://discourse.julialang.org/t/undef-for-array-and-sharedarray-initialisation/14366" rel="nofollow">on the Discourse forum</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rdeits/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rdeits">@rdeits</a> suggested aligning the <code class="notranslate">SharedArray</code> API to that of general arrays, which seems like a good idea to me.</p>