Skip to content

Commit

Permalink
Avoid DeclareGlobalVariable, InstallValue (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Jan 12, 2024
1 parent 3c05337 commit 1fa0ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
6 changes: 0 additions & 6 deletions gap/nq.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ DeclareGlobalFunction( "NqEpimorphismByNqOutput" );
DeclareGlobalFunction( "NilpotentEngelQuotient" );
DeclareGlobalFunction( "LowerCentralFactors" );

DeclareGlobalVariable( "NqGlobalVariables" );
DeclareGlobalVariable( "NqDefaultOptions" );
DeclareGlobalVariable( "NqOneTimeOptions" );
DeclareGlobalVariable( "NqRuntime" );
DeclareGlobalVariable( "NqGapOutput" );


DeclareOperation( "NilpotentQuotient",
[ IsObject, IsPosInt ] );
Expand Down
10 changes: 3 additions & 7 deletions gap/nq.gi
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@
##
## Initialize the runtime variable.
##
MakeReadWriteGlobal( "NqRuntime" );
NqRuntime := 0;
MakeReadOnlyGlobal( "NqRuntime" );
BindGlobal( "NqRuntime", 0 );

#############################################################################
##
#V NqGapOutput
##
MakeReadWriteGlobal( "NqGapOutput" );
NqGapOutput := false;

#############################################################################
Expand All @@ -34,7 +31,7 @@ NqGapOutput := false;
## -s check only instances with semigroup words - this is only
## relevant if one of the Engel options is used
##
InstallValue( NqDefaultOptions, [ "-g", "-p", "-C", "-s" ] );
BindGlobal( "NqDefaultOptions", [ "-g", "-p", "-C", "-s" ] );


#############################################################################
Expand All @@ -44,7 +41,6 @@ InstallValue( NqDefaultOptions, [ "-g", "-p", "-C", "-s" ] );
## This variable can be used to pass a list of options to the next call of
## the nq program.
##
MakeReadWriteGlobal( "NqOneTimeOptions" );
NqOneTimeOptions := [];

#############################################################################
Expand Down Expand Up @@ -223,7 +219,7 @@ end;
##
#F NqGlobalVariables . . global variables to communicate with the nq program
##
InstallValue( NqGlobalVariables,
BindGlobal( "NqGlobalVariables",
[ "NqLowerCentralFactors", ## factors of the LCS
"NqNrGenerators",
"NqClass",
Expand Down

0 comments on commit 1fa0ad8

Please sign in to comment.