You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following example, we see that defining the 3-argument form of show is required to change the output of a type, but the 2-argument form must also be explicitly defined to get the desired behaviour inside another data structure (e.g. an array). cc @shashi
julia>using StaticArrays
julia> Base.show{N,T}(io::IO, ::MIME"text/plain", vec::SVector{N,T}) =print(io, "Hello")
show (generic function with 203 methods)
julia>SVector(1,2)
Hello
julia> [SVector(1,2,3)]
1-element Array{StaticArrays.SVector{3,Int64},1}:
[1,2,3]
julia> Base.show{N,T}(io::IO, vec::SVector{N,T}) =print(io, "Hello")
show (generic function with 204 methods)
julia> [SVector(1,2,3)]
1-element Array{StaticArrays.SVector{3,Int64},1}:
Hello
Also,
julia> immutable X x end
julia> X(SVector(2,2))
X(Hello)
The text was updated successfully, but these errors were encountered:
In the following example, we see that defining the 3-argument form of
show
is required to change the output of a type, but the 2-argument form must also be explicitly defined to get the desired behaviour inside another data structure (e.g. an array). cc @shashiAlso,
The text was updated successfully, but these errors were encountered: