# Listing the functions defined in a package

Assume that I know a package's (Context?) name that is loaded. Now I want to list the functions defined in this package. How can I do it?

I remember that I found a way once, but I cannot re-find it. I tried some combinations with ? but for vain.

-

Possibly this way:

<< PrimalityProving

?PrimalityProving*


or alternatively (see the copy&paste issue in the comments)

?"PrimalityProving*"


See also the help under ref/Information, subsection "Generalizations & Extensions". In some cases you have to provide a string argument:

Information["*Values"]


-
Thanks! This is exactly what I was looking for. – Dror Mar 28 '12 at 10:48
In version 7 I need ?"PrimalityProving*" (string). Is this no longer the case in v8?  – Mr.Wizard Mar 28 '12 at 11:42
With 8.04 it works without quotes . I´ll add the quoted version. – Yves Klett Mar 28 '12 at 12:49
@Mr.Wizard this is just a copy/paste issue that arises from pasting ?PrimalityProving* into a cell after something else. It doesn't paste correctly in 8 either but will work without the quotes in either version if pasted into a cell on its own or typed in directly. – Oleksandr R. Mar 28 '12 at 13:25
The above lists all the public functions. In addition, doing Context** will list the functions in the  Private  context and other subcontexts nested one level (most packages do not go beyond that). I've found some neat helper functions that way... – R. M. Jul 29 '12 at 5:23

Another possibility:

<< PrimalityProving

Names["PrimalityProving*"]

   {CertificateDiscriminant, CertificateK, CertificateM,
CertificateNextPrime, CertificatePoint, CertificatePrime, fact,
HilbertPolynomial, ModularInvariantj, PointEC, PointECQ,
PrimeQCertificate, PrimeQCertificateCheck, ProvablePrimeQ}

-
Of course you'd want to use this form, with explicit mention of Names, in case you were trying to get the list of package names from within other code. – murray Mar 28 '12 at 14:56

I made a little interactive thing ('reportPackages') that often proves helpful. It lives in my own utilities package:

?? reportPackages


reportPackages::usage = "reportPackages produces a window with a SetterBar and a button. The SetterBar lists all currently linked Packages (from $Packages). The button produces a clickable list of exported Symbols of a selected Package. Clicking a symbolname gives its usage note if present ";  reportPackages := DynamicModule[{pakket, functies}, Column[{SetterBar[Dynamic[pakket],$Packages,
Appearance -> "Row"],
Column[{Dynamic[functies = pakket <> "*"],
Button["info",
Information[Evaluate[functies], LongForm -> False]] }] }] //
Framed];

-