Skip to content

Commit

Permalink
document recursive for GAP.Obj and GAP.GapObj
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBreuer committed Nov 30, 2022
1 parent ad3e631 commit 4a71b88
Showing 1 changed file with 18 additions and 0 deletions.
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

0 comments on commit 4a71b88

Please sign in to comment.