Re: [julia-users] Creating a show method for type alias

2015-08-14 Thread Ben Ward
I tried this too, to override the method for Array{CIGAR, 1} but it still does not work: function Base.show(io::IO, cigarstr::Array{CIGAR, 1}) write(io, convert(String, cigarstr)) end On Tuesday, August 11, 2015 at 9:22:09 AM UTC+1, Mauro wrote: I think you cannot create a show method

Re: [julia-users] Creating a show method for type alias

2015-08-11 Thread Mauro
I think you cannot create a show method for a typealias as it is indistinguishable from the type it aliases. On Mon, 2015-08-10 at 19:07, Ben Ward axolotlfan9...@gmail.com wrote: Hi, I have implemented a basic immutable type with a type alias for a vector of said type: immutable CIGAR

[julia-users] Creating a show method for type alias

2015-08-10 Thread Ben Ward
Hi, I have implemented a basic immutable type with a type alias for a vector of said type: immutable CIGAR OP::Operation Size::Int end function CIGAR(op::Char, size::Int) return CIGAR(Operation(op), size) end function convert(::Type{String}, cigar::CIGAR) return