Skip to content

Commit

Permalink
improved the manual of the GAP package JuliaInterface
Browse files Browse the repository at this point in the history
- 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")
  • Loading branch information
ThomasBreuer committed Mar 4, 2020
1 parent 32d46f2 commit 5f09ff1
Show file tree
Hide file tree
Showing 11 changed files with 871 additions and 107 deletions.
8 changes: 4 additions & 4 deletions pkg/GAPJulia/JuliaInterface/PackageInfo.g
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# JuliaInterface: Test interface to julia
# JuliaInterface: Interface to Julia
#
# This file contains package meta data. For additional information on
# the meaning and correct usage of these fields, please consult the
Expand All @@ -9,7 +9,7 @@
SetPackageInfo( rec(

PackageName := "JuliaInterface",
Subtitle := "Test interface to julia",
Subtitle := "Interface to Julia",
Version := "0.2.6",
Date := "04/02/2020", # dd/mm/yyyy format
License := "GPL-2.0-or-later",
Expand Down Expand Up @@ -75,11 +75,11 @@ PackageDoc := [ rec(
HTMLStart := "doc/chap0.html",
PDFFile := "doc/manual.pdf",
SixFile := "doc/manual.six",
LongTitle := "Test interface to julia",
LongTitle := "Interface to &Julia;",
) ],

Dependencies := rec(
GAP := ">= 4.11", # need support for the component 'BannerFunction'
GAP := ">= 4.11", # need compatible code in GAP's src/julia_gc.c
NeededOtherPackages := [ ],
SuggestedOtherPackages := [ ],
ExternalConditions := [ ],
Expand Down
28 changes: 17 additions & 11 deletions pkg/GAPJulia/JuliaInterface/gap/BindCFunction.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,33 @@
## Sebastian Gutsche, Siegen University
##
#! @Chapter Function integration
##
#############################################################################

#! @Section Julia functions in GAP
#! @Section &Julia; functions in ⪆

#! @Arguments julia_name, nr_args, arg_names
#! @Arguments julia_name, arg_names
#! @Returns a function
#! @Description
#! Returns a GAP function that acts like a kernel function in GAP,
#! but calls the Julia function <A>julia_name</A>. The function in Julia
#! must exist, bound to the global name <A>julia_name</A> in the module <C>Main</C>,
#! and must be callable on <A>nr_args</A> arguments. <A>arg_name</A> must
#! be a list of strings of length <A>nr_args</A> describing the argument names
#! Returns a &GAP; function that acts like a kernel function in &GAP;,
#! but calls the &Julia; function <A>julia_name</A>.
#! The function in &Julia; must exist, be bound to the global name
#! <A>julia_name</A> in the module <C>Main</C>,
#! and must be callable on as many arguments as the length of the list
#! <A>arg_names</A> of strings describing the argument names
#! that are displayed in the function header by &GAP;.
#! @BeginExampleSession
#! ...
#! @EndExampleSession
DeclareGlobalFunction( "JuliaBindCFunction" );

#! @Section GAP functions in Julia

#! @Arguments func, name, argument_number
#! @Returns nothing
#! @Description
#! Sets the function <A>func</A> in Julia as <C>GAP.</C><A>name</A>.
#! The resulting function is then callable from Julia on <A>argument_number</A> arguments.
#! Sets the function <A>func</A> in &Julia; as <C>GAP.</C><A>name</A>.
#! The resulting function is then callable from &Julia; on <A>argument_number</A> arguments.
#! @BeginExampleSession
#! ...
#! @EndExampleSession
#! TODO: Does this function ever get installed?
DeclareGlobalFunction( "JuliaSetGAPFuncAsJuliaObjFunc" );
2 changes: 1 addition & 1 deletion pkg/GAPJulia/JuliaInterface/gap/BindCFunction.gi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ InstallGlobalFunction( JuliaBindCFunction,
arg_names := List( arg_names, Immutable );
MakeImmutable( arg_names );
else
ErrorNoReturn( "second argument must be a string or a a list of strings" );
ErrorNoReturn( "second argument must be a string or a list of strings" );
fi;

nr_args := Length( arg_names );
Expand Down
Loading

0 comments on commit 5f09ff1

Please sign in to comment.