I am not clear on how I should define the appearance of a type on the Julia REPL. There are a number of similar sounding functions, including: display, show, print, writemime etc.
You need to overload Base.show() for the type.
julia> import Base: show
julia> type Foo
x
y
z
end
julia> Base.show(io::IO, f::Foo) = println(io, "Foo: x=$(f.x), y=$(f.y), z=$(f.z)")
show (generic function with 98 methods)
julia> Foo("Hello ", "World", "!")
Foo: x=Hello, y=World, z=!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With