diff --git a/gap/bytable.gi b/gap/bytable.gi index c35280b..fd028b6 100644 --- a/gap/bytable.gi +++ b/gap/bytable.gi @@ -408,20 +408,15 @@ InstallOtherMethod(DirectProductOp, function (list, first) local n, item, i, jof, bigtable; n := Length(list); - Print("Hi", n, "\n"); - # Simple checks - Print("Ho", n=0, "\n"); - Print("Ha", n<1, "\n"); - # Why does the following fail? + # Simple checks if n < 1 then Error("Usage: Cannot take DirectProduct of zero items."); + elif n < 2 then + return list[1]; fi; -# if n < 2 then -# return list[1]; -# fi; # See if we can handle all objects for i in [2..n] do - if not HasMultiplicationTable(list(i)) then + if not HasMultiplicationTable(list[i]) then return DirectProductOp(Permuted(list, (1,i)), list[i]); fi; od;