-
Notifications
You must be signed in to change notification settings - Fork 21
Define vectorized get
?
#87
Comments
Seems like that's equivalent to Is the goal less verbose sugar? |
aha, didn't know about that |
Maybe |
julia> methods(convert, Tuple{Any,Any,Any,Vararg{Any}})
7-element Array{Any,1}:
convert(::Type{ASCIIString}, a::Array{UInt8,1}, invalids_as::ASCIIString) at ascii.jl:115
convert(::Type{ASCIIString}, a::Array{UInt8,1}, invalids_as::AbstractString) at ascii.jl:132
convert(::Type{UTF8String}, a::Array{UInt8,1}, invalids_as::AbstractString) at unicode/utf8.jl:293
convert{Tv<:Union{Complex{Float64},Float64}}(::Type{Base.SparseArrays.CHOLMOD.Sparse{Tv<:Union{Complex{Float64},Float64}}}, m::Integer, n::Integer, colptr::Array{Int64,1}, rowval::Array{Int64,1}, nzval::Array{Tv<:Union{Complex{Float64},Float64},1}, stype) at sparse/cholmod.jl:811
convert{Tv<:Union{Complex{Float64},Float64}}(::Type{Base.SparseArrays.CHOLMOD.Sparse{Tv<:Union{Complex{Float64},Float64}}}, m::Integer, n::Integer, colptr::Array{Int64,1}, rowval::Array{Int64,1}, nzval::Array{Tv<:Union{Complex{Float64},Float64},1}) at sparse/cholmod.jl:832
convert{Tv<:Union{Complex{Float64},Float64}}(::Type{Base.SparseArrays.CHOLMOD.Sparse{Tv<:Union{Complex{Float64},Float64}}}, A::SparseMatrixCSC{Tv<:Union{Complex{Float64},Float64},Int64}, stype::Integer) at sparse/cholmod.jl:842
convert{T}(::Type{Base.SparseArrays.CHOLMOD.Sparse{Tv<:Union{Complex{Float64},Float64}}}, A::Union{Hermitian{T,SparseMatrixCSC{T,Int64}},SparseMatrixCSC{T,Int64},Symmetric{T,SparseMatrixCSC{T,Int64}}}, args...) at sparse/cholmod.jl:875 So there is precedence with the string methods. But I agree, I favor using the same vocabulary as the scalar case. |
It's a little more complicated than that. There are three things you need to be able to do: fail on NULL, replace NULL and remove NULL. So you're not really using the same vocabulary as the scalar case, except for this specific variant. In particular, the best idiom anyone's proposed so far for the remove NULL variant is |
I think it'd be really useful to have a NullableArray equivalent of
get(A, default)
.Something along the lines of:
The text was updated successfully, but these errors were encountered: