To add to my question, something seems odd about that arrow. For example 
Julia 0.4 is happy with

$ cat test_doc2.jl
@doc doc"Some function." ->
something(x) = x;

@doc doc"A simpler function." ->
something() = 1;

and lists the documentation of both methods. So I presume the arrow is 
missing in the example 
of http://docs.julialang.org/en/latest/manual/documentation/#functions-methods.

In my example with the constructor, it gives me an error though:

$ cat test_doc.jl
@doc doc"Some type." ->
type Something
  x :: Float64;
end

@doc doc"Simple constructor." ->
Something() = Something(1.0);

julia> VERSION
v"0.4.0-dev+4559"

julia> include("test_doc.jl")
ERROR: LoadError: MethodError: `doc` has no method matching doc(::Type{
Something}, ::Method, ::Base.Markdown.MD, ::Expr)
Closest candidates are:
  doc(::Function, ::Method, ::Any, ::Any)
  doc(::Any, ::Any)
  doc(::Function, ::Method)
  ...
 in anonymous at docs.jl:43
 in include at /Applications/Julia-0.4.0-dev-060e5090e7.app/Contents/
Resources/julia/lib/julia/sys.dylib
 in include_from_node1 at /Applications/Julia-0.4.0-dev-060e5090e7.app/
Contents/Resources/julia/lib/julia/sys.dylib
while loading /private/tmp/test_doc.jl, in expression starting on line 6



On Friday, May 1, 2015 at 12:49:28 PM UTC-4, Dominique Orban wrote:
>
> In 
> http://docs.julialang.org/en/latest/manual/documentation/#functions-methods 
> it would be worth emphasizing that the docstring of the second method isn't 
> followed by an arrow.
>
> If I apply the same philosophy to constructors I only seem to get the 
> type's documentation:
>
> $cat test_doc.jl
> @doc doc"Some type." ->
> type Something
>   x :: Float64;
> end
>
> @doc doc"Simple constructor."  # No arrow!
> Something() = Something(1.0);
>
> julia> VERSION
> v"0.4.0-dev+4559"
>
> julia> include("test_doc.jl")
>
> help?> Something
> search: Something
>
>   Some type.
>
> julia> @doc Something
>   Some type.
>
> In 0.3, Docile lists all the possibilities. How do I access the 
> constructor's documentation?
>

Reply via email to