Hello all,

I was exploring some of the base code today when I saw the implementation 
of setindex!():


setindex!{T}(A::Array{T}, x, i0::Real) = arrayset(A, convert(T,x), to_index(i0))

I was surprised that I couldn't find setindex!() methods for elements that used 
the type system to forego the use of convert() seen above. 
For example, wouldn't it be better to also define methods of the form 

setindex!{T}(A::Array{T}, x::T, i0::Real) = arrayset(A, x, to_index(i0))

so that conversion only occurs when necessary?

I would be willing to make the changes myself, but I assume that there is a 
reason for this design choice that I'm just seeing. 

Reply via email to