The way I understand it, Julia has no syntax for single column (size (n,1)) 
matrix literals.
Of course 

    [1 2]

    [1 2;
     3 4]

both create matrices, and I would have hoped that

    [1;]

    [1;
     2]

would as well, but they create vectors instead. I still hope that this can 
be changed at some point (seem to remember that it has been discussed, but 
can't remember where).

But given the current state, what is the recommended way to get something 
like matrix literals?
I could define a function

    mat(a::AbstractVector) = reshape(a,(size(a,1),1))
    mat(a::AbstractMatrix) = a

and then use e.g. 

    mat([1;
         2])

I first tried with

    mat(a) = convert(Matrix, a)

and then

    mat{T}(a::AbstractArray{T}) = convert(Matrix{T}, a)

but those both gave method errors. Shouldn't those conversions be defined?
I know that I can use double transpose [1;]'' but given the discussions 
about dual vectors, that might not be future proof.

Reply via email to