<p dir="auto">It's a little sad that this isn't defined. For instance, in <a href="https://github.com/ChrisRackauckas/VectorizedRoutines.jl">VectorizedRoutines.jl</a>, the implementation of <a href="https://github.com/ChrisRackauckas/VectorizedRoutines.jl/blob/master/src/r.jl"><code class="notranslate">rep</code></a> taking a number as the first argument has to either create a temporary array, or duplicate code, or create an immutable <code class="notranslate">AbstractArray</code> subtype that wraps a number. Neither are very attractive.</p>
<p dir="auto">Is there any reason why the definition</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="eachindex(::Number) = 1"><pre class="notranslate"><span class="pl-en">eachindex</span>(<span class="pl-k">::</span><span class="pl-c1">Number</span>) <span class="pl-k">=</span> <span class="pl-c1">1</span></pre></div>
<p dir="auto">does not exist? I realize <code class="notranslate">Number</code>s are not <code class="notranslate">AbstractArray</code>s, but neither are <code class="notranslate">Tuple</code>s or <code class="notranslate">Associative</code>s. If this definition seems acceptable to most, I'll make a PR.</p>
<p dir="auto">On master, I get</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; FloatRange(10.0,1.0,11.0,10.0)
WARNING: FloatRange{T}(start::T, step, len, den) is deprecated, use Base.floatrange(T, start, step, len, den) instead.
Stacktrace:
 [1] depwarn(::String, ::Symbol) at ./deprecated.jl:62
 [2] FloatRange(::Float64, ::Float64, ::Float64, ::Float64) at ./deprecated.jl:50
 [3] eval(::Module, ::Any) at ./boot.jl:236
 [4] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:66
 [5] macro expansion at ./REPL.jl:97 [inlined]
 [6] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73
while loading no file, in expression starting on line 0
ERROR: MethodError: no method matching floatrange(::Type{Float64}, ::Float64, ::Float64, ::Float64, ::Float64)
Closest candidates are:
  floatrange(::AbstractFloat, ::AbstractFloat, ::Real, ::AbstractFloat) at twiceprecision.jl:108
  floatrange{T}(::Type{T}, ::Integer, ::Integer, ::Integer, ::Integer) at twiceprecision.jl:94
Stacktrace:
 [1] FloatRange(::Float64, ::Float64, ::Float64, ::Float64) at ./deprecated.jl:52"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">FloatRange</span>(<span class="pl-c1">10.0</span>,<span class="pl-c1">1.0</span>,<span class="pl-c1">11.0</span>,<span class="pl-c1">10.0</span>)
WARNING<span class="pl-k">:</span> <span class="pl-c1">FloatRange</span><span class="pl-c1">{T}</span>(start<span class="pl-k">::</span><span class="pl-c1">T</span>, step, len, den) is deprecated, use Base<span class="pl-k">.</span><span class="pl-c1">floatrange</span>(T, start, step, len, den) instead.
Stacktrace<span class="pl-k">:</span>
 [<span class="pl-c1">1</span>] <span class="pl-c1">depwarn</span>(<span class="pl-k">::</span><span class="pl-c1">String</span>, <span class="pl-k">::</span><span class="pl-c1">Symbol</span>) at <span class="pl-k">./</span>deprecated<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">62</span>
 [<span class="pl-c1">2</span>] <span class="pl-c1">FloatRange</span>(<span class="pl-k">::</span><span class="pl-c1">Float64</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>) at <span class="pl-k">./</span>deprecated<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">50</span>
 [<span class="pl-c1">3</span>] <span class="pl-c1">eval</span>(<span class="pl-k">::</span><span class="pl-c1">Module</span>, <span class="pl-k">::</span><span class="pl-c1">Any</span>) at <span class="pl-k">./</span>boot<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">236</span>
 [<span class="pl-c1">4</span>] <span class="pl-c1">eval_user_input</span>(<span class="pl-k">::</span><span class="pl-c1">Any</span>, <span class="pl-k">::</span><span class="pl-c1">Base.REPL.REPLBackend</span>) at <span class="pl-k">./</span>REPL<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">66</span>
 [<span class="pl-c1">5</span>] <span class="pl-k">macro</span> expansion at <span class="pl-k">./</span>REPL<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">97</span> [inlined]
 [<span class="pl-c1">6</span>] (<span class="pl-k">::</span><span class="pl-c1">Base.REPL.</span><span class="pl-c"><span class="pl-c">#</span>#1#2{Base.REPL.REPLBackend})() at ./event.jl:73</span>
<span class="pl-k">while</span> loading no file, <span class="pl-k">in</span> expression starting on line <span class="pl-c1">0</span>
ERROR<span class="pl-k">:</span> MethodError<span class="pl-k">:</span> no method matching <span class="pl-c1">floatrange</span>(<span class="pl-k">::</span><span class="pl-c1">Type{Float64}</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>)
Closest candidates are<span class="pl-k">:</span>
  <span class="pl-c1">floatrange</span>(<span class="pl-k">::</span><span class="pl-c1">AbstractFloat</span>, <span class="pl-k">::</span><span class="pl-c1">AbstractFloat</span>, <span class="pl-k">::</span><span class="pl-c1">Real</span>, <span class="pl-k">::</span><span class="pl-c1">AbstractFloat</span>) at twiceprecision<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">108</span>
  <span class="pl-c1">floatrange</span><span class="pl-c1">{T}</span>(<span class="pl-k">::</span><span class="pl-c1">Type{T}</span>, <span class="pl-k">::</span><span class="pl-c1">Integer</span>, <span class="pl-k">::</span><span class="pl-c1">Integer</span>, <span class="pl-k">::</span><span class="pl-c1">Integer</span>, <span class="pl-k">::</span><span class="pl-c1">Integer</span>) at twiceprecision<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">94</span>
Stacktrace<span class="pl-k">:</span>
 [<span class="pl-c1">1</span>] <span class="pl-c1">FloatRange</span>(<span class="pl-k">::</span><span class="pl-c1">Float64</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>, <span class="pl-k">::</span><span class="pl-c1">Float64</span>) at <span class="pl-k">./</span>deprecated<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">52</span></pre></div>
<p dir="auto">This broke <code class="notranslate">StatsBase</code>.</p>
<p dir="auto">cc: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/timholy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/timholy">@timholy</a></p>