Skip to content

Commit

Permalink
Replace RecFields by RecNames, mark it as obsolete
Browse files Browse the repository at this point in the history
This function name was used in GAP 3 but has been deprecated in GAP 4.
  • Loading branch information
fingolfin committed Jun 27, 2017
1 parent f9bcd1d commit 7310982
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/memusage.gi
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ InstallMethod( MemoryUsage, "for a record",
MEMUSAGECACHE_DEPTH := MEMUSAGECACHE_DEPTH + 1;
mem := SHALLOW_SIZE(o) + MU_MemBagHeader + MU_MemPointer;
# Again the bag, its header, and the master pointer
for i in RecFields(o) do
for i in RecNames(o) do
s := o.(i);
if SHALLOW_SIZE(s) > 0 then # a subobject!
mem := mem + MemoryUsage(s);
Expand Down
9 changes: 9 additions & 0 deletions lib/obsolete.gd
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,15 @@ end);
## still used by Browse, ctbllib, profiling, resclasses (01/2016)
DeclareGlobalFunction( "USER_HOME_EXPAND" );

#############################################################################
##
#F RecFields
##
## This name stems from GAP 3 days.
##
## still used by Browse, ctbllib, gapdoc, genss, io, orb (05/2017)
DeclareObsoleteSynonym( "RecFields", "RecNames", "4.0" );

#############################################################################
##
#E
Expand Down
2 changes: 0 additions & 2 deletions lib/record.g
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ DeclareOperationKernel( "Unbind.", [ IsObject, IsObject ], UNB_REC );
##
DeclareAttribute( "RecNames", IsRecord );

DeclareSynonym( "RecFields", RecNames );


#############################################################################
##
Expand Down
2 changes: 1 addition & 1 deletion lib/sgpres.gi
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ InstallGlobalFunction( AugmentedCosetTableRrs,
fi;

# ensure that all components of the augmented coset table are immutable.
for field in RecFields( aug ) do
for field in RecNames( aug ) do
MakeImmutable( aug.(field) );
od;

Expand Down
4 changes: 2 additions & 2 deletions lib/string.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ InstallGlobalFunction(PrintCSV,function(arg)
else
rf:=[];
for i in l do
r:=RecFields(i);
r:=RecNames(i);
for j in r do
if not j in rf then
Add(rf,j);
Expand Down Expand Up @@ -1070,7 +1070,7 @@ local f,i,j,format,cold,a,e,z,str,new,box,lc,mini,color,alt,renum;
color:=fail;
# row 1 indicates which columns are relevant and their formatting
cold:=ShallowCopy(l[1]);
f:=RecFields(cold);
f:=RecNames(cold);
renum:=[];
for i in ShallowCopy(f) do

Expand Down
6 changes: 3 additions & 3 deletions lib/test.gi
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ InstallGlobalFunction(RunTests, function(arg)
tests := arg[1];
opts := rec( breakOnError := false, showProgress := "some" );
if Length(arg) > 1 and IsRecord(arg[2]) then
for f in RecFields(arg[2]) do
for f in RecNames(arg[2]) do
opts.(f) := arg[2].(f);
od;
fi;
Expand Down Expand Up @@ -372,7 +372,7 @@ InstallGlobalFunction("Test", function(arg)
end,
subsWindowsLineBreaks := true,
);
for c in RecFields(nopts) do
for c in RecNames(nopts) do
opts.(c) := nopts.(c);
od;
# check shortcuts
Expand Down Expand Up @@ -592,7 +592,7 @@ InstallGlobalFunction( "TestDirectory", function(arg)
exitGAP := false,
);

for c in RecFields(nopts) do
for c in RecNames(nopts) do
opts.(c) := nopts.(c);
od;

Expand Down

0 comments on commit 7310982

Please sign in to comment.