<p dir="auto">For previous discussion, see: <a href="https://groups.google.com/forum/#!topic/julia-users/FBmU-mxQ0k4" rel="nofollow">https://groups.google.com/forum/#!topic/julia-users/FBmU-mxQ0k4</a></p>
<p dir="auto">My request is to have functionality to be able to initialize a vector of size <code class="notranslate">N</code> and type <code class="notranslate">T</code> using the <code class="notranslate">Vector(T, N)</code> command. This would be equivalent to the current <code class="notranslate">Array(T, N)</code>. The reason for this is that it if I have a function taking a <code class="notranslate">Vector</code> argument it feels nice to create the vector I send in to the function using a <code class="notranslate">Vector</code> constructor. Same for matrices.</p>
<p dir="auto">I tried to implement it myself like this (and in some other ways) but it is not working:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Base.call{T}(::Vector{T}, size::Int) = Array(T, size)"><pre class="notranslate">Base<span class="pl-k">.</span><span class="pl-en">call</span><span class="pl-c1">{T}</span>(<span class="pl-k">::</span><span class="pl-c1">Vector{T}</span>, size<span class="pl-k">::</span><span class="pl-c1">Int</span>) <span class="pl-k">=</span> <span class="pl-c1">Array</span>(T, size)</pre></div>
<p dir="auto">Both Dict and Array are parametric types. Constructing a Dict and an Array of variable size differs markedly, though:<br>
* <code class="notranslate">Dict{TypeA,TypeB}()</code><br>
* <code class="notranslate">Array(Type)</code> while <code class="notranslate">Array{Type}()</code> doesn't work<br>
This creates some confusion for people new to the language – also I think its inconsistent design.</p>