How can I see the list of methods in a Julia Packa

2019-05-11 11:45发布

Is there a command in Julia that lists all the methods that are available in a package?

For example I load up Distributions

using Distributions

and now I would like to see what function to call to draw a random value from a normal distribution. Is there a good way to do this from inside of Julia without a google search?

标签: julia
1条回答
2楼-- · 2019-05-11 12:46

Sort of, although I don't think its of much utility:

julia> using Distributions

julia> names(Distributions)
215-element Array{Symbol,1}:
 :median
 :logpdf
 :logpmf!
 :Chisq
 :posterior_rand
 :fit_mle!
 :NegativeBinomial
 :posterior_rand!
 :ContinuousMatrixDistribution
 :ValueSupport
 :InverseGamma
 :complete
 :TDist
 :NormalCanon
 :SufficientStats
 :Chi
 :logpmf
 :logdetcov
 :Gumbel
 :Sampleable
 ...

or non-programmatically, using

julia> whos(Distributions)
AbstractMixtureModel          DataType
AbstractMvNormal              DataType
Arcsine                       DataType
Bernoulli                     DataType
Beta                          DataType
BetaPrime                     DataType
Binomial                      DataType

I think that with the inclusion of an inbuilt documentation system in Julia 0.4, we'll get way more packages with docs available at the REPL.

查看更多
登录 后发表回答