Re: [julia-users] Use of convert() within setindex!() in array.jl

2014-04-26 Thread Jarrett Revels
Ah, makes sense. Thanks! On Saturday, April 26, 2014 12:33:48 PM UTC-4, Tim Holy wrote: > > When x is of type T, convert(T,x) is a no-op: > > julia> function myfunc(x) >a = convert(Float64, x) >return a >end > myfunc (generic function with 1 method) > > julia

Re: [julia-users] Use of convert() within setindex!() in array.jl

2014-04-26 Thread Tim Holy
When x is of type T, convert(T,x) is a no-op: julia> function myfunc(x) a = convert(Float64, x) return a end myfunc (generic function with 1 method) julia> code_native(myfunc, (Float32,)) .text Filename: none Source line: 2 pushRBP mov

[julia-users] Use of convert() within setindex!() in array.jl

2014-04-26 Thread Jarrett Revels
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 u