Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added IsLIBGAP constant #2528

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/init.g
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,17 @@ BindGlobal ("ShowSystemInformation", function ()
ShowPackageInformation();
end );


#############################################################################
##
## Initialize the IsLIBGAP variable (if not done before). If this variable
## is false, an interactive session will be started.
## Otherwise no interactive session is started.
##
if not IsBound( IsLIBGAP ) then
BIND_CONSTANT( "IsLIBGAP", false );
fi;

#############################################################################
##
## Finally, deal with the lists of global variables.
Expand Down Expand Up @@ -1016,7 +1027,9 @@ InstallAndCallPostRestore( function()
od;
end );

if IsHPCGAP and THREAD_UI() then
if IsLIBGAP then
# GAP is used as a library, do not start an interactive session
elif IsHPCGAP and THREAD_UI() then
ReadLib("hpc/consoleui.g");
MULTI_SESSION();
else
Expand Down
12 changes: 12 additions & 0 deletions tst/testinstall/IsLIBGAP.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#############################################################################
##
#W IsLIBGAP.tst GAP library Sebastian Gutsche
##
##
#Y Copyright (C) 2018, GAP Group
##
gap> START_TEST("IsLIBGAP.tst");
gap> IsBound( IsLIBGAP );
true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to run ./gap tst/testinstall.g before submitting an updated version of this PR, to make sure it really works.

gap> STOP_TEST( "IsLIBGAP.tst", 1);