Skip to content

Commit 16d628d

Browse files
Remove arg representing variadic arguments in function lists, except when it is the only argument
1 parent cf73a54 commit 16d628d

4 files changed

Lines changed: 8 additions & 15 deletions

File tree

lib/function.gi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
##
2121

2222
InstallGlobalFunction(CallWithTimeout,
23-
function( timeout, func, arg )
23+
function( timeout, func, arg... )
2424
return CallWithTimeoutList(timeout, func, arg);
2525
end );
2626

@@ -83,4 +83,3 @@ end);
8383

8484

8585

86-

lib/gpprmsya.gi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ end);
910910
##
911911
#M StabilizerOp( <nat-sym-grp>, ...... )
912912
##
913-
SYMGP_STABILIZER := function(sym, arg)
913+
SYMGP_STABILIZER := function(sym, arg...)
914914
local k, act, pt, mov, stab, nat, diff, int, bls, mov1, parts,
915915
part, bl, i, gens, size;
916916
k := Length(arg);
@@ -1012,7 +1012,7 @@ InstallOtherMethod( StabilizerOp,"alternating group", true,
10121012
# the objects might be a group element: rank up
10131013
RankFilter(IsMultiplicativeElementWithInverse) +
10141014
RankFilter(IsSolvableGroup),
1015-
function(g, arg)
1015+
function(g, arg...)
10161016
return AlternatingSubgroup(CallFuncList(Stabilizer, Concatenation([SymmetricParentGroup(g)], arg)));
10171017
end);
10181018

@@ -1022,7 +1022,7 @@ InstallOtherMethod( StabilizerOp,"alternating group", true,
10221022
# the objects might be a group element: rank up
10231023
RankFilter(IsMultiplicativeElementWithInverse) +
10241024
RankFilter(IsSolvableGroup),
1025-
function(g, arg)
1025+
function(g, arg...)
10261026
return AlternatingSubgroup(CallFuncList(Stabilizer, Concatenation([SymmetricParentGroup(g)], arg)));
10271027
end);
10281028

src/read.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ void ReadFuncExpr (
11141114
{
11151115
volatile Obj nams; /* list of local variables names */
11161116
volatile Obj name; /* one local variable name */
1117-
volatile UInt narg; /* number of arguments */
1117+
volatile Int narg; /* number of arguments */
11181118
volatile UInt isvarg = 0; /* does function have varargs? */
11191119
volatile UInt nloc; /* number of locals */
11201120
volatile UInt nr; /* number of statements */
@@ -1278,12 +1278,9 @@ void ReadFuncExpr (
12781278
/* Also, we special case function(arg) */
12791279
if (isvarg || ( narg == 1 && ! strcmp( "arg", CSTR_STRING( ELM_LIST(nams, narg) ) )) )
12801280
{
1281-
/* TODO: remove this before the next non-beta release */
1282-
if (narg > 1 && ! strcmp( "arg", CSTR_STRING( ELM_LIST(nams, narg) ) ) )
1283-
SyntaxWarning("New syntax used -- intentional?");
12841281
narg = -narg;
12851282
}
1286-
1283+
12871284
/* if ( narg == 1 && ! strcmp( "arg", CSTR_STRING( ELM_LIST(nams,1) ) ) )
12881285
narg = -1; */
12891286

tst/testinstall/timeout.tst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
gap> START_TEST("timeout.tst");
2-
gap> spinFor := function(ms, arg) local t;
2+
gap> spinFor := function(ms, arg...) local t;
33
> t := Runtimes().user_time + Runtimes().system_time;
44
> while Runtimes().user_time + Runtimes().system_time < t + ms do od;
55
> if Length(arg) >= 1
66
> then return arg[1]; else return; fi; end;
7-
Syntax warning: New syntax used -- intentional? in stream line 2
8-
t := Runtimes().user_time + Runtimes().system_time;
9-
^
10-
function( ms, arg ) ... end
7+
function( ms, arg... ) ... end
118
gap> spinFor(10);
129
gap> spinFor(10,0);
1310
0

0 commit comments

Comments
 (0)