From 83e40972a796884dfb7d53b6c1043765c63316f3 Mon Sep 17 00:00:00 2001 From: kalmar Date: Fri, 12 May 2017 19:48:33 +0200 Subject: [PATCH] define show for <:GSymbol --- src/FPGroups.jl | 8 -------- src/Groups.jl | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/FPGroups.jl b/src/FPGroups.jl index 4f5a8dd..3fc06d1 100644 --- a/src/FPGroups.jl +++ b/src/FPGroups.jl @@ -100,14 +100,6 @@ function show(io::IO, G::FPGroup) print(io, "rels:\t", join([rel for rel in G.rels], ", ")) end -function show(io::IO, s::FPSymbol) - if isone(s) - print(io, "(id)") - elseif s.pow == 1 - print(io, s.str) - else - print(io, (s.str)*"^$(s.pow)") - end end ############################################################################### diff --git a/src/Groups.jl b/src/Groups.jl index 5c53105..54bd806 100644 --- a/src/Groups.jl +++ b/src/Groups.jl @@ -150,6 +150,16 @@ function show(io::IO, W::GWord) end end +function show{T<:GSymbol}(io::IO, s::T) + if isone(s) + print(io, "(id)") + elseif s.pow == 1 + print(io, s.str) + else + print(io, (s.str)*"^$(s.pow)") + end +end + ############################################################################### # # Comparison