`getindex` for vector creation
With
julia> @which Int[1, 2, 3, 4]
getindex(::Type{T}, vals...) where T
@ Base array.jl:397
we expect to create an array. However, something like
julia> ZZ[1, 2, 3, 4]
julia> ZZ[ZZ(1), ZZ(2), ZZ(3), ZZ(4)]
does not work, but should?
Should it, though? The Julia syntax is for T[1,2,3] where T is a type. While we indeed allow specifying a ring instead of a type in many situations, I don't think that's an automatism.
Generally we don't want people to use a Vector{BigInt} resp. (in Nemo) a Vector{ZZRingElem}, as such this might even be counter productive?
I am open to discuss this and be convinced otherwise, though :-)
Ping @fieker @thofma
I don't mind too much that people create Vector{ZZRingElem}. When I wrote in #2053 that it is ambiguous, I did not mean in the compiler ambiguity sense, but that is hard to explain to a user why R[1] and R[1, 2] do different things. For example, ZZ[1] throws, but ZZ[1, 2] gives a Vector.
Generally we don't want people to use a
Vector{BigInt}resp. (in Nemo) aVector{ZZRingElem}, as such this might even be counter productive?
We could make a C-style vector instead of Julia vectors.
But I'm fine with closing this as well.
Edit: We could make an $m \times 1$ matrix. But, if we close this, I think one should not be able to write ZZ[1 2; 3 4].
there is a c-style Vector{ZZRingElem} in Hecke:src/Sparse/ZZRow.jl - it has its own pittfalls
What is the rational behind R[1] giving the first generator? After some thinking, I think I'd prefer to abandon this instead.