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

Restore old Associative show method as print #7147

Merged
merged 2 commits into from
Jun 9, 2014

Conversation

mbauman
Copy link
Sponsor Member

@mbauman mbauman commented Jun 5, 2014

This should fix #7142 and JuliaIO/JSON.jl#72. The previous Associative show method is now the print method.

@JeffBezanson
Copy link
Sponsor Member

This should define show instead of print, since show is called by repr. It should work like arrays; see replutil.jl:26 (writemime).

* The fancy showdict and showkv display method is now called from writemime within replutil.
* The plain dict printing method is simply show
* Plain key and value iterator show methods added, which simply show their collection without any additional markup
* The fancy showdict and showkv now accept keyword arguments to be more inline with showarray.
@mbauman
Copy link
Sponsor Member Author

mbauman commented Jun 6, 2014

Updated. But I'm totally confused by the test failures. I don't understand how this would mess up the inference of expm. Here's the cause, cribbed from linalg3.jl:152:

julia> function foo()
           A5  = [ 0. 0. 0. 0. ; 0. 0. -im 0.; 0. im 0. 0.; 0. 0. 0. 0.]
           expm(A5)
       end
foo (generic function with 1 method)

julia> code_typed(foo,())
1-element Array{Any,1}:
 :($(Expr(:lambda, {}, {{:A5},{{:A5,Array{T,2},18}},{}}, :(begin  # none, line 2:
        A5 = hvcat(top(tuple)(4,4,4,4)::(Int64,Int64,Int64,Int64),0.0,0.0,0.0,0.0,0.0,0.0,$(Expr(:new, Complex{Int64}, :(top(box)(Int64,top(neg_int)(top(box)(Int64,top(zext_int)(Int64,top(getfield)(im::Complex{Bool},:re)::Bool))::Int64))::Int64), :(top(box)(Int64,top(neg_int)(top(box)(Int64,top(zext_int)(Int64,top(getfield)(im::Complex{Bool},:im)::Bool))::Int64))::Int64)))::Complex{Int64},0.0,0.0,im,0.0,0.0,0.0,0.0,0.0,0.0)::Array{T,2} # line 3:
        return expm(A5::Array{T,2})::Array{None,2}
    end::Array{None,2}))))

All tests pass if I comment out that one expm(A5) call.

@mbauman
Copy link
Sponsor Member Author

mbauman commented Jun 6, 2014

Even stranger: the test failure can be simply triggered simply by a print method for dict. See: https://github.com/mbauman/julia/compare/test-expm-failure

It may have something to do with the bootstrap procedure; defining Base.print interactively does not cause the same problem.

JeffBezanson added a commit that referenced this pull request Jun 9, 2014
JeffBezanson added a commit that referenced this pull request Jun 9, 2014
Restore old Associative show method as print
@JeffBezanson JeffBezanson merged commit d7552f3 into JuliaLang:master Jun 9, 2014
@mbauman mbauman deleted the dict-print branch June 9, 2014 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No more parsable output for Dict printing
2 participants