Skip to content

Commit

Permalink
Add printing of kwargs... if the function accept variable number of k…
Browse files Browse the repository at this point in the history
…eywords.
  • Loading branch information
dhoegh committed May 30, 2016
1 parent 15626c3 commit e4cabab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@
sparams))
(keyword-sparam-names
(map (lambda (s) (if (symbol? s) s (cadr s))) keyword-sparams)))
(let ((kw (gensy)) (i (gensy)) (ii (gensy)) (elt (gensy)) (rkw (gensy))
(let ((kw (gensy)) (i (gensy)) (ii (gensy)) (elt (gensy))
(rkw (if (null? restkw) '() (symbol (string (car restkw) "..."))))
(mangled (symbol (string "#" (if name (undot-name name) 'call) "#"
(string (current-julia-module-counter)))))
(flags (map (lambda (x) (gensy)) vals)))
Expand Down
4 changes: 2 additions & 2 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,10 @@ end

f5971(x, y...; z=1, w...) = nothing
let repr = sprint(io -> show(io,"text/plain", methods(f5971)))
@test contains(repr, "f5971(x, y...; z)")
@test contains(repr, "f5971(x, y...; z, w...)")
end
let repr = sprint(io -> show(io,"text/html", methods(f5971)))
@test contains(repr, "f5971(x, y...; <i>z</i>)")
@test contains(repr, "f5971(x, y...; <i>z, w...</i>)")
end

if isempty(Base.GIT_VERSION_INFO.commit)
Expand Down

0 comments on commit e4cabab

Please sign in to comment.