From 203e084ff3ba5b171f4d19634e76ccd32e09d2fe Mon Sep 17 00:00:00 2001 From: kalmarek Date: Thu, 22 Mar 2018 10:49:52 +0100 Subject: [PATCH] don't print overly long presentations --- src/FPGroups.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/FPGroups.jl b/src/FPGroups.jl index 568bd15..59389bd 100644 --- a/src/FPGroups.jl +++ b/src/FPGroups.jl @@ -104,8 +104,13 @@ length(s::FPSymbol) = abs(s.pow) ############################################################################### function show(io::IO, G::FPGroup) - print(io, "FPgroup on $(length(G.gens)) generators: ") - print(io, "⟨ ", join(G.gens, ", "), " | ", join(G.rels, ", "), " ⟩.") + print(io, "FPgroup on $(length(G.gens)) generators ") + strrels = join(G.rels, ", ") + if length(strrels) > 300 + print(io, "⟨ ", join(G.gens, ", "), " | $(length(G.rels)) relation(s) ⟩.") + else + print(io, "⟨ ", join(G.gens, ", "), " | ", join(G.rels, ", "), " ⟩.") + end end ###############################################################################