diff --git a/gap/cliques.gi b/gap/cliques.gi index fced5e253..56f58f3ca 100644 --- a/gap/cliques.gi +++ b/gap/cliques.gi @@ -126,7 +126,7 @@ end); ################################################################################ InstallGlobalFunction(DigraphMaximalIndependentSet, -function(arg) +function(arg...) if IsEmpty(arg) then ErrorNoReturn("at least 1 argument is required,"); elif not IsDigraph(arg[1]) then @@ -141,7 +141,7 @@ function(arg) end); InstallGlobalFunction(DigraphIndependentSet, -function(arg) +function(arg...) if IsEmpty(arg) then ErrorNoReturn("at least 1 argument is required,"); elif not IsDigraph(arg[1]) then @@ -158,7 +158,7 @@ end); # Independent sets orbit representatives InstallGlobalFunction(DigraphIndependentSetsReps, -function(arg) +function(arg...) if IsEmpty(arg) then ErrorNoReturn("at least 1 argument is required,"); elif not IsDigraph(arg[1]) then @@ -175,7 +175,7 @@ InstallMethod(DigraphIndependentSetsAttr, "for a digraph", [IsDigraph], DigraphIndependentSets); InstallGlobalFunction(DigraphIndependentSets, -function(arg) +function(arg...) local D, out; if IsEmpty(arg) then ErrorNoReturn("at least 1 argument is required,"); @@ -202,7 +202,7 @@ InstallMethod(DigraphMaximalIndependentSetsRepsAttr, "for a digraph", [IsDigraph], DigraphMaximalIndependentSetsReps); InstallGlobalFunction(DigraphMaximalIndependentSetsReps, -function(arg) +function(arg...) local out, D; if IsEmpty(arg) then ErrorNoReturn("at least 1 argument is required,"); @@ -229,7 +229,7 @@ InstallMethod(DigraphMaximalIndependentSetsAttr, "for a digraph", [IsDigraph], DigraphMaximalIndependentSets); InstallGlobalFunction(DigraphMaximalIndependentSets, -function(arg) +function(arg...) local D, out; if IsEmpty(arg) then ErrorNoReturn("at least 1 argument is required,"); @@ -254,7 +254,7 @@ end); # Cliques InstallGlobalFunction(DigraphMaximalClique, -function(arg) +function(arg...) if IsEmpty(arg) then ErrorNoReturn("at least 1 argument is required,"); fi; @@ -263,7 +263,7 @@ function(arg) end); InstallGlobalFunction(DigraphClique, -function(arg) +function(arg...) if IsEmpty(arg) then ErrorNoReturn("at least 1 argument is required,"); fi; @@ -272,7 +272,7 @@ function(arg) end); InstallGlobalFunction(DIGRAPHS_Clique, -function(arg) +function(arg...) local maximal, D, include, exclude, size, out, try, include_copy, v; maximal := arg[1]; @@ -369,7 +369,7 @@ end); # Cliques orbit representatives InstallGlobalFunction(DigraphCliquesReps, -function(arg) +function(arg...) local D, include, exclude, limit, size; if IsEmpty(arg) then @@ -412,7 +412,7 @@ InstallMethod(DigraphCliquesAttr, "for a digraph", [IsDigraph], DigraphCliques); InstallGlobalFunction(DigraphCliques, -function(arg) +function(arg...) local D, include, exclude, limit, size, out; if IsEmpty(arg) then @@ -467,7 +467,7 @@ InstallMethod(DigraphMaximalCliquesRepsAttr, "for a digraph", [IsDigraph], DigraphMaximalCliquesReps); InstallGlobalFunction(DigraphMaximalCliquesReps, -function(arg) +function(arg...) local D, include, exclude, limit, size, out; if IsEmpty(arg) then @@ -521,7 +521,7 @@ InstallMethod(DigraphMaximalCliquesAttr, "for a digraph", [IsDigraph], DigraphMaximalCliques); InstallGlobalFunction(DigraphMaximalCliques, -function(arg) +function(arg...) local D, include, exclude, limit, size, cliques, sub, G, out, orbits, c; if IsEmpty(arg) then @@ -1041,7 +1041,7 @@ function(D, hook, param, lim, inc, exc, max, size, reps, inc_var, exc_var) to_try := ListBlist(vtx, try); fi; - if not G = fail then + if G <> fail then to_try := List(Orbits(G, to_try), x -> x[1]); fi; diff --git a/gap/digraph.gi b/gap/digraph.gi index 488d962ba..21ab2bae8 100644 --- a/gap/digraph.gi +++ b/gap/digraph.gi @@ -1221,7 +1221,7 @@ function(filt, digraph, gps, homs) local red, n, hom_table, reps, rep, top, doms, starts, degs, max, gens, img, start, deg, x, queue, j, k, g, y, hom, edge, i, gen; - if not filt = IsPartialPermSemigroup then + if filt <> IsPartialPermSemigroup then TryNextMethod(); elif not IsJoinSemilatticeDigraph(digraph) then if IsMeetSemilatticeDigraph(digraph) then @@ -1335,7 +1335,7 @@ function(filt, digraph, gps, homs) # agrees with the composition we are currently considering. if IsBound(img[start]) then y := PermList(img{[start .. start + deg - 1]} - start + 1); - if not x = y then + if x <> y then ErrorNoReturn("the homomorphisms given must form a commutative", " diagram,"); fi; diff --git a/gap/display.gi b/gap/display.gi index f55429169..b578f8d60 100644 --- a/gap/display.gi +++ b/gap/display.gi @@ -52,11 +52,7 @@ function(str) od; fi; fi; - if x = (l - 1) then - return true; - else - return false; - fi; + return x = (l - 1); end); BindGlobal("DIGRAPHS_GraphvizColorsList", fail); @@ -266,7 +262,7 @@ if not IsBound(Splash) then # This function is written by A. Egri-Nagy ["xpdf", "xdg-open", "open", "evince", "okular", "gv"]); BindGlobal("Splash", - function(arg) + function(arg...) local str, opt, path, dir, tdir, file, viewer, type, inn, filetype, out, engine; diff --git a/gap/grahom.gi b/gap/grahom.gi index 1b7d854b6..34a2f393d 100644 --- a/gap/grahom.gi +++ b/gap/grahom.gi @@ -11,7 +11,7 @@ ## InstallGlobalFunction(GeneratorsOfEndomorphismMonoid, -function(arg) +function(arg...) local D, limit, colours, G, gens, limit_arg, out; if IsEmpty(arg) then ErrorNoReturn("at least 1 argument expected, found 0,"); diff --git a/gap/io.gi b/gap/io.gi index ebf3b0310..383f393b4 100644 --- a/gap/io.gi +++ b/gap/io.gi @@ -168,7 +168,7 @@ end; ################################################################################ InstallGlobalFunction(IteratorFromDigraphFile, -function(arg) +function(arg...) local filename, decoder, file, record; if Length(arg) = 1 then @@ -314,7 +314,7 @@ function(filename) end); InstallGlobalFunction(DigraphFile, -function(arg) +function(arg...) local coder, mode, name, file; # defaults @@ -374,7 +374,7 @@ function(arg) end); InstallGlobalFunction(ReadDigraphs, -function(arg) +function(arg...) local nr, decoder, name, file, i, next, out; # defaults @@ -455,7 +455,7 @@ function(arg) end); InstallGlobalFunction(WriteDigraphs, -function(arg) +function(arg...) local name, digraphs, encoder, mode, splitname, compext, g6sum, s6sum, v, e, dg6sum, ds6sum, file, D, i; diff --git a/gap/isomorph.gi b/gap/isomorph.gi index d00bef066..4398878ea 100644 --- a/gap/isomorph.gi +++ b/gap/isomorph.gi @@ -296,7 +296,7 @@ InstallMethod(BlissAutomorphismGroup, "for a digraph, fail, and edge colouring", [IsDigraph, IsBool, IsList], function(digraph, vert_colours, edge_colours) - if not vert_colours = fail then + if vert_colours <> fail then TryNextMethod(); fi; return BLISS_DATA(digraph, vert_colours, edge_colours)[1]; diff --git a/gap/oper.gi b/gap/oper.gi index 8e72d8af7..428fae5d4 100644 --- a/gap/oper.gi +++ b/gap/oper.gi @@ -608,7 +608,7 @@ end); ############################################################################# InstallGlobalFunction(DIGRAPHS_CombinationOperProcessArgs, -function(arg) +function(arg...) local copy, i; arg := ShallowCopy(arg[1]); if IsMutableDigraph(arg[1]) then @@ -633,7 +633,7 @@ function(arg) end); InstallGlobalFunction(DigraphDisjointUnion, -function(arg) +function(arg...) local D, offset, n, i, j; # Allow the possibility of supplying arguments in a list. @@ -668,7 +668,7 @@ function(arg) end); InstallGlobalFunction(DigraphJoin, -function(arg) +function(arg...) local D, tot, offset, n, list, i, v; # Allow the possibility of supplying arguments in a list. if Length(arg) = 1 and IsList(arg[1]) then @@ -708,7 +708,7 @@ function(arg) end); InstallGlobalFunction(DigraphEdgeUnion, -function(arg) +function(arg...) local D, n, i, v; # Allow the possibility of supplying arguments in a list. @@ -748,7 +748,7 @@ function(arg) end); InstallGlobalFunction(DigraphCartesianProduct, -function(arg) +function(arg...) local D, n, i, j, proj, m, labs; # Allow the possibility of supplying arguments in a list. @@ -794,7 +794,7 @@ function(arg) end); InstallGlobalFunction(DigraphDirectProduct, -function(arg) +function(arg...) local D, n, i, j, proj, m, labs; # Allow the possibility of supplying arguments in a list. diff --git a/gap/utils.gi b/gap/utils.gi index eba57674b..e978cecfe 100644 --- a/gap/utils.gi +++ b/gap/utils.gi @@ -135,7 +135,7 @@ function() end); InstallGlobalFunction(DigraphsTestStandard, -function(arg) +function(arg...) local opts, dir; if Length(arg) = 1 and IsRecord(arg[1]) then opts := ShallowCopy(arg[1]); @@ -164,7 +164,7 @@ function(arg) end); InstallGlobalFunction(DigraphsTestExtreme, -function(arg) +function(arg...) local file, opts, dir; file := Filename(DirectoriesPackageLibrary("digraphs", "digraphs-lib"), "extreme.d6.gz"); @@ -212,7 +212,7 @@ function() end); InstallGlobalFunction(DigraphsTestManualExamples, -function(arg) +function(arg...) local exlists, indices, omit, oldscr, passed, pad, total, l, sp, bad, s, start_time, test, end_time, elapsed, pex, str, j, ex, i; @@ -587,7 +587,7 @@ function(blist) end); InstallGlobalFunction(DError, -function(arg) +function(arg...) local msg; if not (IsString(arg[1]) or IsList(arg[1])) then Error("expected a string or a list as the 1st argument");