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

destructuring in SIGNATURES show #temp #67

Open
tpapp opened this issue Sep 4, 2018 · 2 comments
Open

destructuring in SIGNATURES show #temp #67

tpapp opened this issue Sep 4, 2018 · 2 comments

Comments

@tpapp
Copy link
Contributor

tpapp commented Sep 4, 2018

julia> using DocStringExtensions

julia> """
       $(SIGNATURES)
       
       This function destructures!
       """
       function f((x, y))
           x + y
       end
f

julia> @doc f
  f(#temp#)
  

  This function destructures!

julia> VERSION
v"1.0.1-pre.0"

it would be nice to have f((x, y)).

@tpapp
Copy link
Contributor Author

tpapp commented Sep 5, 2018

I am kind of stuck with this one, eg

julia> using DocStringExtensions

julia> function f((x, y))
       x + y
       end
f (generic function with 1 method)

julia> ms = DocStringExtensions.get_method_source(first(methods(f)))
CodeInfo(
 2 1%1 = (Base.indexed_iterate)(#temp#@_2, 1)                                          │
   │        x = (Core.getfield)(%1, 1)                                                    │
   │        #temp#@_5 = (Core.getfield)(%1, 2)                                            │%4 = (Base.indexed_iterate)(#temp#@_2, 2, #temp#@_5)                               │
   │        y = (Core.getfield)(%4, 1)                                                    │
   │        #temp#@_5 = (Core.getfield)(%4, 2)                                            │%7 = x + y                                                                         │
   └──      return %7                                                                     │
)

julia> ms.slotnames
5-element Array{Any,1}:
 Symbol("#self#")
 Symbol("#temp#")
 :x              
 :y              
 Symbol("#temp#")

so I don't see how I can simply extend the existing arguments method.

Suggestions would be appreciated.

@MichaelHatherly
Copy link
Member

We should be able to use #133 to fixup this issue and get the correct symbols printed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants