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

Use Julia v0.6 syntax #1

Closed
wants to merge 1 commit into from
Closed

Use Julia v0.6 syntax #1

wants to merge 1 commit into from

Conversation

wsshin
Copy link
Collaborator

@wsshin wsshin commented Jun 9, 2017

This PR incorporates Julia v0.6 syntax to the package. Now that StaticArrays uses Julia v0.6 (JuliaArrays/StaticArrays.jl#183), it seems reasonable to require v0.6 as the minimum Julia version.

Here is the summary of changes:

  • abstractabstract type ... end
  • typestruct (instead of mutable struct, assuming the internal data of Object do not change in most cases)
  • use of where ... for parametrization
  • sumabs2sum(abs2, ...)
  • dot syntax for min, max, sqrt, etc

@stevengj
Copy link
Owner

stevengj commented Jun 9, 2017

immutable etc still work in 0.6 with no warning. I don't want to switch to the new keywords until 0.6 is out for a while and most people have switched

@stevengj stevengj closed this Jun 9, 2017
@wsshin
Copy link
Collaborator Author

wsshin commented Jun 9, 2017

I see... That makes sense. Thanks!

@wsshin
Copy link
Collaborator Author

wsshin commented Jun 9, 2017

Wait... Actually I get the following deprecation warnings in 0.6:

WARNING: deprecated syntax "abstract Object{N}" at /Users/wsshin/.julia/v0.6/GeometryPrimitives/src/GeometryPrimitives.jl:6.
Use "abstract type Object{N} end" instead.

WARNING: deprecated syntax "inner constructor Ellipsoid(...) around /Users/wsshin/.julia/v0.6/GeometryPrimitives/src/ellipsoid.jl:8".
Use "Ellipsoid{N,D}(...) where {N,D}" instead.

and so on.

Also, I get

WARNING: sumabs2(x) is deprecated, use sum(abs2, x) instead.
...
WARNING: sumabs2(A, region) is deprecated, use sum(abs2, A, region) instead.
...
WARNING: min{T1 <: Real, T2 <: Real}(x::AbstractArray{T1}, y::AbstractArray{T2}) is deprecated, use min.(x, y) instead.
...
WARNING: max{T1 <: Real, T2 <: Real}(x::AbstractArray{T1}, y::AbstractArray{T2}) is deprecated, use max.(x, y) instead.

How about these warnings? If you want, I can create a PR to take care of them only.

@wsshin
Copy link
Collaborator Author

wsshin commented Jun 9, 2017

OK, I figured that the second set of warnings (about sumabs2 and min, max) can be eliminated without breaking compatibility with Julia v0.5.

However, the first set of warnings above (about abstract and inner constructors) will need to be just ignored for now, because fixing them will make the package incompatible with Julia v0.5. (Question: is this something that can be handled by Compat? If possible, it will be nice to eliminate these warnings as well.)

@stevengj
Copy link
Owner

The Compat package can be used to eliminate the other warnings without breaking backward compatibility

@wsshin wsshin deleted the julia-0.6-syntax branch June 10, 2017 04:53
@wsshin wsshin restored the julia-0.6-syntax branch June 10, 2017 04:54
@wsshin
Copy link
Collaborator Author

wsshin commented Jun 10, 2017

Just made a new PR #2.

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.

2 participants