Do we have an easy way to retrieve documentation for constructors separately
from the documentation of a type? I spent a few minutes looking at the source
and searching issues, and got to the point where I thought it was better to
ask before, say, considering a PR.
Illustration:
"""
Foo is a type that represents some amazing stuff
"""
type Foo
end
"""
`foo = Foo(7)` creates an empty `Foo` instance with room for 7 LittleFoos
in it.
"""
Foo(n::Integer) = nothing
"""
`foo = Foo(x, y)` puts the LittleFoos `x` and `y` into a grown-up Foo.
"""
Foo(x, y) = nothing
Now let's try it:
help?> Foo
search: Foo floor ifloor pointer_from_objref OverflowError RoundFromZero
FileMonitor functionloc functionlocs StackOverflowError Factorization
OutOfMemoryError
Foo is a type that represents some amazing stuff
Now, if I know how to call the constructor I want, then it's no problem to
retrieve the documentation:
help?> Foo(7)
foo = Foo(7) creates an empty Foo instance with room for 7 LittleFoos in
it.
But what if I don't know my choices? Here are two things I tried:
julia> @eval @doc $(methods(Foo))
help?> call(Type{Foo})
call(x, args...)
If x is not a Function, then x(args...) is equivalent to call(x, args...).
This means that function-like behavior can be added to any type by defining new
call methods.
Neither produced useful results. Any thoughts?
Best,
--Tim