1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-10-15 07:20:35 +02:00

define show for <:GSymbol

This commit is contained in:
kalmar 2017-05-12 19:48:33 +02:00
parent 3d944d2de2
commit 83e40972a7
2 changed files with 10 additions and 8 deletions

View File

@ -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
###############################################################################

View File

@ -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