-
Notifications
You must be signed in to change notification settings - Fork 22
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
improved the manual of the GAP package JuliaInterface #353
improved the manual of the GAP package JuliaInterface #353
Conversation
Codecov Report
@@ Coverage Diff @@
## master #353 +/- ##
==========================================
- Coverage 76.65% 76.58% -0.07%
==========================================
Files 62 61 -1
Lines 4467 4480 +13
==========================================
+ Hits 3424 3431 +7
- Misses 1043 1049 +6 |
- added documentation for many GAP functions - reordered some GAP code such that the ordering fits to the documentation - added a few `JuliaToGAP` conversions (which were marked as "TODO")
112c0f2
to
5f09ff1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Some minor comments; but I'd also be fine with merging this right now. We can fill in the TODOs and incomplete parts later, but it is already now a nice improvement. Thanks!
#! <Example> | ||
#! gap> GAPToJulia( 1 ); | ||
#! 1 | ||
#! gap> GAPToJulia( JuliaEvalString( "Rational{Int64}" ), 1 ); | ||
#! <Julia: 1//1> | ||
#! gap> l:= [ 1, 3, 4 ];; | ||
#! gap> GAPToJulia( l ); | ||
#! <Julia: Any[1, 3, 4]> | ||
#! gap> GAPToJulia( JuliaEvalString( "Array{Int,1}" ), l ); | ||
#! <Julia: [1, 3, 4]> | ||
#! gap> m:= [ [ 1, 2 ], [ 3, 4 ] ];; | ||
#! gap> GAPToJulia( m ); | ||
#! <Julia: Any[Any[1, 2], Any[3, 4]]> | ||
#! gap> GAPToJulia( JuliaEvalString( "Array{Int,2}" ), m ); | ||
#! <Julia: [1 2; 3 4]> | ||
#! gap> r:= rec( a:= 1, b:= [ 1, 2, 3 ] );; | ||
#! gap> GAPToJulia( r ); | ||
#! <Julia: Dict{Symbol,Any}(:a => 1,:b => Any[1, 2, 3])> | ||
#! </Example> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this (and similar in other exampels)
#! <Example> | |
#! gap> GAPToJulia( 1 ); | |
#! 1 | |
#! gap> GAPToJulia( JuliaEvalString( "Rational{Int64}" ), 1 ); | |
#! <Julia: 1//1> | |
#! gap> l:= [ 1, 3, 4 ];; | |
#! gap> GAPToJulia( l ); | |
#! <Julia: Any[1, 3, 4]> | |
#! gap> GAPToJulia( JuliaEvalString( "Array{Int,1}" ), l ); | |
#! <Julia: [1, 3, 4]> | |
#! gap> m:= [ [ 1, 2 ], [ 3, 4 ] ];; | |
#! gap> GAPToJulia( m ); | |
#! <Julia: Any[Any[1, 2], Any[3, 4]]> | |
#! gap> GAPToJulia( JuliaEvalString( "Array{Int,2}" ), m ); | |
#! <Julia: [1 2; 3 4]> | |
#! gap> r:= rec( a:= 1, b:= [ 1, 2, 3 ] );; | |
#! gap> GAPToJulia( r ); | |
#! <Julia: Dict{Symbol,Any}(:a => 1,:b => Any[1, 2, 3])> | |
#! </Example> | |
#! <Example><![CDATA[ | |
#! gap> GAPToJulia( 1 ); | |
#! 1 | |
#! gap> GAPToJulia( JuliaEvalString( "Rational{Int64}" ), 1 ); | |
#! <Julia: 1//1> | |
#! gap> l:= [ 1, 3, 4 ];; | |
#! gap> GAPToJulia( l ); | |
#! <Julia: Any[1, 3, 4]> | |
#! gap> GAPToJulia( JuliaEvalString( "Array{Int,1}" ), l ); | |
#! <Julia: [1, 3, 4]> | |
#! gap> m:= [ [ 1, 2 ], [ 3, 4 ] ];; | |
#! gap> GAPToJulia( m ); | |
#! <Julia: Any[Any[1, 2], Any[3, 4]]> | |
#! gap> GAPToJulia( JuliaEvalString( "Array{Int,2}" ), m ); | |
#! <Julia: [1 2; 3 4]> | |
#! gap> r:= rec( a:= 1, b:= [ 1, 2, 3 ] );; | |
#! gap> GAPToJulia( r ); | |
#! <Julia: Dict{Symbol,Any}(:a => 1,:b => Any[1, 2, 3])> | |
#! ]]></Example> |
#! implemented by calling <C>gap_to_julia</C> or vice versa. | ||
#! (Pro constructors: <C>BigInt(x)</C> is shorter than | ||
#! <C>gap_to_julia(BigInt, x)</C>. | ||
#! Con constructors: symmetry perhaps?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: not (yet?) clear how to deal with recursive conversions that preserve identity. I.e. converting the GAP list [ ~ ]
which contains itself, or something like [ "x", ~[1] ]
which contains the same (identical) string twice. Of course for many applications this is irrelevant, but maybe not for some others.
That said, I absolutely think we should offer these constructors, but retain gap_to_julia
(at least for now, as people are using it, and it has the above mentioned recursive feature)
#! </Item> | ||
#! <Item> | ||
#! Add conversions from &Julia; bigints and rationals over | ||
#! various integer types, including bigints, to &GAP;. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also want to be able to efficiently convert between GAP integers and fmpz
. See also https://github.com/oscar-system/GAPGroups.jl/issues/3
JuliaToGAP
conversions (which were marked as "TODO")