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.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityPossibly 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"]
?"PrimalityProving`*"
(string). Is this no longer the case in v8? `
$\endgroup$
Mar 28, 2012 at 11:42
?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.
$\endgroup$
Mar 28, 2012 at 13:25
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...
$\endgroup$
Another possibility:
<< PrimalityProving`
Names["PrimalityProving`*"]
{CertificateDiscriminant, CertificateK, CertificateM, CertificateNextPrime, CertificatePoint, CertificatePrime, fact, HilbertPolynomial, ModularInvariantj, PointEC, PointECQ, PrimeQCertificate, PrimeQCertificateCheck, ProvablePrimeQ}
Names
, in case you were trying to get the list of package names from within other code.
$\endgroup$
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];