Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atsign-doc can't be used with macros #9259

Closed
timholy opened this issue Dec 6, 2014 · 4 comments
Closed

atsign-doc can't be used with macros #9259

timholy opened this issue Dec 6, 2014 · 4 comments
Labels
docs This change adds or pertains to documentation

Comments

@timholy
Copy link
Member

timholy commented Dec 6, 2014

julia> @doc "A function" f() = 3
f (generic function with 1 method)

julia> @doc f
  A function

julia> @doc "An inlined function" @inline g() = 4
(anonymous function)

julia> g()
ERROR: g not defined

julia> @doc g
ERROR: g not defined

julia> @inline h() = 6
h (generic function with 1 method)

julia> h()
6
@ivarne ivarne added the docs This change adds or pertains to documentation label Dec 6, 2014
@mschauer
Copy link
Contributor

mschauer commented Dec 9, 2014

For the moment this works: @doc "An inlined function" -> @inline g() = 4

@fcard
Copy link
Contributor

fcard commented Jun 2, 2015

I know how to fix this for macros with one or more arguments, but how do you propose the results of zero-argument macros be documented, syntax-wise? Currently @doc "something" @m documents @m itself, not the result of @m().

(@mschauer's solution doesn't work anymore, because this inconsistency between the two notations has been fixed.

This works but is a bit awkward I think:
@doc "an inlined funcion" (() -> @inline global g() = 4)(), or
@doc "an inlined funcion" (0; @inline g() = 4),
or anything that hides the macro-call into a expression that returns its value.

)

@fcard
Copy link
Contributor

fcard commented Jul 22, 2015

This was fixed by #12000.

@yuyichao
Copy link
Contributor

Right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

No branches or pull requests

5 participants