Tim, is this with 0.4 or 0.5? The behaviour of type/constructor docs was 
changed quite recently
to be more similar to that of function/method docs. On 0.5 `help?> Foo` 
should concatenate all
the docstrings for `Foo` and it's constructors. Is that the behaviour 
you're looking for?

-- Mike

On Saturday, 30 January 2016 14:26:25 UTC+2, Tim Holy wrote:
>
> 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 
>
>

Reply via email to