On Thu, Mar 12 2015, Ivar Nesje wrote:
>>
>> So, what you would want to do is `Array{String,1}()`.
>> That ought to construct a array of strings with dimension 1 but doesn't.
>
>
> But in 0.4 you can use Array{String,1}(0) to create a 1d array with 0
> elements. Note that you have to provide the size of the array, and 0 is not
> default (, but maybe it should be?)
Array{T}(dims...)
is equivalent to
Array{T,length(dims)}(dims...)
while the latter has a redundant parameter. So instead of providing a
default for dims..., wouldn't
Array{T}(0)
be an idiomatic solution for creating an empty vector of eltype T? Has
one less character than
Array{T,1}(0)
:D
Best,
Tamas