diff --git a/dev/basics/index.html b/dev/basics/index.html
index 400ef6f47..53eaf7b52 100644
--- a/dev/basics/index.html
+++ b/dev/basics/index.html
@@ -21,7 +21,7 @@
julia> GAP.Globals.Julia # Julia objects can be values of GAP variables
Main
-sourceGAP.evalstr — Function
evalstr(cmd::String)
Let GAP execute the command(s) given by cmd; if an error occurs then report this error, otherwise if the last command has a result then return it, otherwise return nothing.
Let GAP execute the command(s) given by cmd; if an error occurs then report this error, otherwise if the last command has a result then return it, otherwise return nothing.
Note that screen outputs caused by evaluating cmd are not shown by evalstr; use evalstr_ex for accessing both the outputs and the return values of the command(s).
In general we recommend to avoid using evalstr, but it sometimes can be a useful escape hatch to access GAP functionality that is otherwise impossible to difficult to reach. But in most typical scenarios it should not be necessary to use it at all.
Instead, use GAP.GapObj or GAP.Obj for constructing GAP objects that correspond to given Julia objects, and call GAP functions directly in the Julia session. For example, executing GAP.evalstr( "x:= []; Add( x, 2 )" ) can be replaced by the Julia code x = GAP.GapObj([]); GAP.Globals.Add(x, 2). Note that the variable x in the former example lives in the GAP session, i.e., it can be accessed as GAP.Globals.x after the call of GAP.evalstr, whereas x in the latter example lives in the Julia session.
Assume that cmd consists of $n$ GAP statements, each terminated by ; or ;;. Let GAP execute these statements and return a GAP list of length $n$ that describes their results. Each entry of the return value is a GAP list of length 5, with the following meaning.
The first entry is true if the statement was executed successfully, and false otherwise.
If the first entry is true, then the second entry is bound to the result of the statement if there was one, and unbound otherwise.
The third entry is unbound if an error occured, true if the statement ends in a double semicolon, and false otherwise.
The fourth entry currently is always unbound.
The fifth entry contains the captured output of the statement as a string. If there was no double semicolon then also the output of GAP.Globals.ViewObj applied to the result value in the second entry, if any, is part of that string.
Examples
julia> GAP.evalstr_ex( "1+2" ) # error due to missing semicolon
+julia> GAP.evalstr( "Print( x )" )
Note that screen outputs caused by evaluating cmd are not shown by evalstr; use evalstr_ex for accessing both the outputs and the return values of the command(s).
In general we recommend to avoid using evalstr, but it sometimes can be a useful escape hatch to access GAP functionality that is otherwise impossible to difficult to reach. But in most typical scenarios it should not be necessary to use it at all.
Instead, use GAP.GapObj or GAP.Obj for constructing GAP objects that correspond to given Julia objects, and call GAP functions directly in the Julia session. For example, executing GAP.evalstr( "x:= []; Add( x, 2 )" ) can be replaced by the Julia code x = GAP.GapObj([]); GAP.Globals.Add(x, 2). Note that the variable x in the former example lives in the GAP session, i.e., it can be accessed as GAP.Globals.x after the call of GAP.evalstr, whereas x in the latter example lives in the Julia session.
Assume that cmd consists of $n$ GAP statements, each terminated by ; or ;;. Let GAP execute these statements and return a GAP list of length $n$ that describes their results. Each entry of the return value is a GAP list of length 5, with the following meaning.
The first entry is true if the statement was executed successfully, and false otherwise.
If the first entry is true, then the second entry is bound to the result of the statement if there was one, and unbound otherwise.
The third entry is unbound if an error occured, true if the statement ends in a double semicolon, and false otherwise.
The fourth entry currently is always unbound.
The fifth entry contains the captured output of the statement as a string. If there was no double semicolon then also the output of GAP.Globals.ViewObj applied to the result value in the second entry, if any, is part of that string.
Examples
julia> GAP.evalstr_ex( "1+2" ) # error due to missing semicolon
GAP: [ [ false,,,, "" ] ]
julia> GAP.evalstr_ex( "1+2;" ) # one statement with return value
@@ -51,11 +51,11 @@
GAP: [ [ true,, false,, "1" ] ]
julia> GAP.evalstr_ex( "" ) # empty input
-GAP: [ ]
Start a GAP prompt where you can enter GAP commands as in a regular GAP session. This prompt can be left as any GAP prompt by either entering quit; or pressing ctrl-D, which returns to the Julia prompt.
This GAP prompt allows to quickly switch between writing Julia and GAP code in a session where all data is shared.
Given a directory path, create three files in that directory:
a shell script named gap.sh which acts like the gap.sh shipped with a regular GAP installation, but which behind the scenes launches GAP via Julia.
two TOML files, Manifest.toml and Project.toml, which are required by gap.sh to function (they record the precise versions of GAP.jl and other Julia packages involved)
The GAP-Julia interface is fully bidirectional, so it is also possible to access all Julia functionality from GAP. To learn more about this, please consult the manual of the GAP package JuliaInterface.
Start a GAP prompt where you can enter GAP commands as in a regular GAP session. This prompt can be left as any GAP prompt by either entering quit; or pressing ctrl-D, which returns to the Julia prompt.
This GAP prompt allows to quickly switch between writing Julia and GAP code in a session where all data is shared.
Given a directory path, create three files in that directory:
a shell script named gap.sh which acts like the gap.sh shipped with a regular GAP installation, but which behind the scenes launches GAP via Julia.
two TOML files, Manifest.toml and Project.toml, which are required by gap.sh to function (they record the precise versions of GAP.jl and other Julia packages involved)
The GAP-Julia interface is fully bidirectional, so it is also possible to access all Julia functionality from GAP. To learn more about this, please consult the manual of the GAP package JuliaInterface.
This is the Julia type of all those GAP objects that are not "immediate" (booleans, small integers, FFEs).
Examples
julia> typeof(GapObj([1, 2])) # a GAP list
GapObj
julia> typeof(GapObj(Dict(:a => 1))) # a GAP record
@@ -94,7 +94,7 @@
GAP: [ [ 1, 2 ], [ 3, 4 ] ]
julia> GapObj(42)
-ERROR: TypeError: in typeassert, expected GapObj, got a value of type Int64
This is an alias for Union{GapObj,FFE,Int64,Bool}. This type union covers all types a "native" GAP object may have from Julia's viewpoint.
Moreover, it can be used as a constructor, in order to convert Julia objects to GAP objects, whenever a suitable conversion has been defined.
Recursive conversion of nested Julia objects (arrays, tuples, dictionaries) can be forced either by a second agument true or by the keyword argument recursive with value true.
Examples
julia> GAP.Obj(1//3)
+ERROR: TypeError: in typeassert, expected GapObj, got a value of type Int64
This is an alias for Union{GapObj,FFE,Int64,Bool}. This type union covers all types a "native" GAP object may have from Julia's viewpoint.
Moreover, it can be used as a constructor, in order to convert Julia objects to GAP objects, whenever a suitable conversion has been defined.
Recursive conversion of nested Julia objects (arrays, tuples, dictionaries) can be forced either by a second agument true or by the keyword argument recursive with value true.
Any GAP integer object is represented in Julia as either a GapObj (if it is a "large" integer) or as an Int (if it is a "small" integer). This type union can be used to express this conveniently, e.g. when one wants to help type stability.
Note that also GAP's infinity and -infinity fit under this type (as do many other objects which are not numbers).