Skip to content

Request: Vector and Matrix constructors. #10075

Description

@KristofferC

For previous discussion, see: https://groups.google.com/forum/#!topic/julia-users/FBmU-mxQ0k4

My request is to have functionality to be able to initialize a vector of size N and type T using the Vector(T, N) command. This would be equivalent to the current Array(T, N). The reason for this is that it if I have a function taking a Vector argument it feels nice to create the vector I send in to the function using a Vector constructor. Same for matrices.

I tried to implement it myself like this (and in some other ways) but it is not working:

Base.call{T}(::Vector{T}, size::Int) = Array(T, size)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs decisionA decision on this change is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions