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
fixed show methods using Cairo for julia v0.5 #907
Conversation
Try blocks behave differently in julia v0.5 compared to v0.4. The new behaviour caused the show methods requiring Cairo to be defined in local scope instead of global scope, which in turn prevented them from being used. See also: JuliaLang/julia#18767
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build is failing on Julia v0.4?
@@ -969,18 +969,16 @@ end | |||
|
|||
try | |||
getfield(Compose, :Cairo) # throws if Cairo isn't being used | |||
@compat function show(io::IO, ::MIME"image/png", p::Plot) | |||
@compat global show(io::IO, ::MIME"image/png", p::Plot) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be global function show
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function
can be omitted for online functions :-) I did remove function on purpose as in julia v0.4 the following code works:
try
global foo(x)=x+1
end
while the following code raises an error:
try
global function foo(x)
x+1
end
end
Nevertheless, a different method for fixing this problem was suggested in JuliaLang/julia#18767 . So I'll give it a try. :-)
Thanks! I'm waiting for JuliaIO/FileIO.jl#85 to merge before I reboot the tests and make sure everything is okay. |
@compat function show(io::IO, ::MIME"application/postscript", p::Plot) | ||
draw(PS(io, Compose.default_graphic_width, | ||
Compose.default_graphic_height), p) | ||
Compose.default_graphic_height), p); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semi-colon is unnecessary, right?
So JuliaIO/FileIO.jl#85 is resolved and I rebooted the tests, if they are all green, I'll go ahead and merge this in |
Try blocks behave differently in julia v0.5 compared to v0.4. The new
behaviour caused the show methods requiring Cairo to be defined in
local scope instead of global scope, which in turn prevented them from
being used. See also:
JuliaLang/julia#18767