[GAP Forum] Accessing source code from GAP folder

Frank Lübeck frank.luebeck at math.rwth-aachen.de
Fri Dec 17 08:45:53 GMT 2021


On Fri, Dec 17, 2021 at 09:49:12AM +0530, Sugandha Maheshwary wrote:
> I am looking for a way to access the source code of certain commands. The
> library has a lot of folders and generally I need to do a lot of guessing
> and trial and error to reach the source code.
> 
> For instance, for the details of source code of
> "WedderburnDecomposition(FG)". I need to follow the path
> "/Users/apple/gap-4.10.2/pkg/wedderga-4.9.5/lib/main.gi"
> 
> Is there a refined way of tracking the same, that can direct me from
> terminal to source code, which does not need remembering the path of folder
> and folder name in which it lies.
> 
> Suppose, if I am looking for source code of the command "AllSubgroups(G)"
> or the sonata package  command "Subgroups(G)", how do I locate the correct
> files?

Dear Sugandha, dear Forum,

You could use the utility function 'PageSource'. It will show you the source
code of a function in a pager and also print the location.

Try for example:

gap> PageSource(AllSubgroups);  # a pager opens ...
Showing source in /my/path/gap4.11/lib/teaching.g (from line 266)
gap> LoadPackage("Sonata");
gap> PageSource(Subgroups);
Showing source in /my/path/gap4.11/pkg/sonata-2.9.1/lib/grpsupp.gi (from line 102)

For other utility functions one can use 'FilenameFunc' and 'StartlineFunc'.

Best regards,
   Frank

-- 
///  Dr. Frank Lübeck, Lehrstuhl für Algebra und Zahlentheorie, 
\\\  Pontdriesch 14/16, 52062 Aachen, Germany
///  E-mail: Frank.Luebeck at Math.RWTH-Aachen.De
\\\  WWW:    http://www.math.rwth-aachen.de/~Frank.Luebeck/



More information about the Forum mailing list