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

improve documentation on special GAP syntax #922

Merged
merged 1 commit into from
Jul 21, 2023
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
30 changes: 18 additions & 12 deletions docs/src/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ DocTestSetup = :(using GAP)

## Accessing GAP from Julia

Any global GAP variable and function can be access from Julia via the
[`GAP.Globals`](@ref) object; for example `GAP.Globals.Binomial(5,3)`.

The [`GAP.prompt`](@ref) command can be used to switch to a GAP session that
works like a regular GAP, except that leaving it (via `quit;` or by pressing
Ctrl-D) returns one to a Julia prompt. From the GAP prompt, one can access
Julia variables via the `Julia` object, for example `Julia.binomial(5,3)`. For
more details on how to access Julia from GAP, please consult
[the manual of the GAP package JuliaInterface](../assets/html/JuliaInterface/chap0_mj.html).

Alternatively, one can start GAP in the traditional way, by executing a shell
script. Such a script can be created in a location of your choice via [`GAP.create_gap_sh`](@ref).
- Any global GAP variable and function can be accessed from Julia via the
[`GAP.Globals`](@ref) object; for example `GAP.Globals.Binomial(5,3)`.
See [Convenience adapters](@ref) for dealing with GAP syntax beyond
simple function calls.

- The [`GAP.prompt`](@ref) command can be used to switch to a GAP session that
works like a regular GAP, except that leaving it (via `quit;` or by pressing
Ctrl-D) returns one to a Julia prompt. From the GAP prompt, one can access
Julia variables via the `Julia` object, for example `Julia.binomial(5,3)`.
For more details on how to access Julia from GAP, please consult
[the manual of the GAP package JuliaInterface](../assets/html/JuliaInterface/chap0_mj.html).

- Alternatively, one can start GAP in the traditional way,
by executing a shell script.
Such a script can be created in a location of your choice
via [`GAP.create_gap_sh`](@ref).
Note that one cannot switch from such a GAP session to the underlying
Julia session and back.

```@docs
Globals
Expand Down
18 changes: 18 additions & 0 deletions docs/src/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ DocTestSetup = :(using GAP)
This section describes how one can manipulate GAP objects from the Julia side,
using Julia syntax features.

In particular, the following is available on the Julia side
in order to support special GAP syntax beyond function calls with arguments.

- Access list/matrix entries via [`getindex`](@ref).

- Access record components via [`getproperty`](@ref).

- Access entries of a positional object via [`getbangindex`](@ref),
equivalent to GAP's `![]` operator.

- Access components of a component object via [`getbangproperty`](@ref),
equivalent to GAP's `!.` operator.

- Check for bound record components via [`hasproperty`](@ref).

- Call functions with global options via [`call_gap_func`](@ref)
or using Julia's keyword argument syntax.

```@docs
call_gap_func
call_with_catch
Expand Down