Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 17 down vote accepted

Possibly this way:

<< PrimalityProving`

?PrimalityProving`*

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

?"PrimalityProving`*"

Mathematica graphics

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

Information["*Values"]

Mathematica graphics

share|improve this answer
    
Thanks! This is exactly what I was looking for. –  Dror Mar 28 '12 at 10:48
1  
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
3  
@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
1  
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... –  rm -rf Jul 29 '12 at 5:23

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];
share|improve this answer

Another possibility:

<< PrimalityProving`

Names["PrimalityProving`*"]
   {CertificateDiscriminant, CertificateK, CertificateM,
    CertificateNextPrime, CertificatePoint, CertificatePrime, fact,
    HilbertPolynomial, ModularInvariantj, PointEC, PointECQ,
    PrimeQCertificate, PrimeQCertificateCheck, ProvablePrimeQ}
share|improve this answer
4  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.