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

document recursive for GAP.Obj and GAP.GapObj #848

Merged
merged 1 commit into from
Nov 30, 2022
Merged
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
18 changes: 18 additions & 0 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ However, this is restricted to outputs that actually are of type `GapObj`.
To also deal with GAP integers, finite field elements and booleans, use
[`GAP.Obj`](@ref) instead.

The keyword argument `recursive` with value `true` can be used to force
recursive conversion of nested Julia objects (arrays, tuples, dictionaries).

# Examples
```jldoctest
julia> GapObj(1//3)
Expand All @@ -102,6 +105,12 @@ GAP: 1/3
julia> GapObj([1 2; 3 4])
GAP: [ [ 1, 2 ], [ 3, 4 ] ]

julia> GAP.GapObj([[1, 2], [3, 4]])
GAP: [ <Julia: [1, 2]>, <Julia: [3, 4]> ]

julia> GAP.GapObj([[1, 2], [3, 4]], recursive = true)
GAP: [ [ 1, 2 ], [ 3, 4 ] ]

julia> GapObj(42)
ERROR: TypeError: in typeassert, expected GapObj, got a value of type Int64

Expand All @@ -119,6 +128,9 @@ Moreover, it can be used as a constructor,
in order to convert Julia objects to GAP objects,
whenever a suitable conversion has been defined.

The keyword argument `recursive` with value `true` can be used to force
recursive conversion of nested Julia objects (arrays, tuples, dictionaries).

# Examples
```jldoctest
julia> GAP.Obj(1//3)
Expand All @@ -127,6 +139,12 @@ GAP: 1/3
julia> GAP.Obj([1 2; 3 4])
GAP: [ [ 1, 2 ], [ 3, 4 ] ]

julia> GAP.Obj([[1, 2], [3, 4]])
GAP: [ <Julia: [1, 2]>, <Julia: [3, 4]> ]

julia> GAP.Obj([[1, 2], [3, 4]], recursive = true)
GAP: [ [ 1, 2 ], [ 3, 4 ] ]

julia> GAP.Obj(42)
42

Expand Down