-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
add at-dot, at-view, and at-views macros; improve at-compat for .= & .+= #316
Conversation
@@ -1596,11 +1596,106 @@ A = view(rand(5,5), 1:3, 1:3) | |||
@test A*D == copy(A) * Diagonal(copy(x)) | |||
|
|||
# julia#17623 | |||
@static if VERSION >= v"0.5.0-dev+5509" # To work around unsupported syntax on Julia 0.4 | |||
if VERSION >= v"0.5.0-dev+5509" | |||
# Use include_string to work around unsupported syntax on Julia 0.4 |
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.
@static
was fine wasn't it?
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.
At least the CI in #304 seemed to think that @static
does not exist in 0.4
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.
It doesn't, but it should exist in Compat
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.
It was passing with @static
, but was still giving a warning in 0.4 (because the warning occurs in the parser, which runs before the macro expansion).
test/runtests.jl
Outdated
|
||
# the following tests fail on 0.5 because of bugs in the 0.5 Base.@view | ||
# macro (a bugfix is scheduled to be backported from 0.6) | ||
if VERSION < v"0.5" |
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.
this should be more specific, otherwise it'll fail on later prereleases and rc's
README.md
Outdated
|
||
* `@views` takes an expression and converts all slices to views ([#20164]), while | ||
`@view` ([#16564]) converts a single array reference to a view ([#20164]). Using `@views` | ||
automatically implies `@compat`. |
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.
given the cutoffs will differ for when @views
will be used from base vs here, relative to everything else @compat
transforms I don't think this should be automatic
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.
Okay, I'll see if I can accommodate this; the interaction with .=
is a little tricky.
Rebased to eliminate a merge conflict. Tests were green before the rebase; assuming they go green again, this should be good to merge? |
Will merge tomorrow if there are no objections. |
@tkelman, why did you delete the newlines at the ends of the files? |
the conflict resolver is annoying like that, wasn't intentional |
if you want to rebase that commit out go ahead, not sure it's worth the CI time though |
* Remove at-compat for type aliases Was added in #326, now obsolete as no longer required on minimum supported Julia version 0.6. * Remove at-compat for Nullable construction Was added in #287, now obsolete as no longer required on minimum supported Julia version 0.6. * Remove at-compat for Foo{<:Bar} sugar Was added in #317 (and #336), now obsolete as no longer required on minimum supported Julia version 0.6. * Remove at-compat for index styles Was added in #329, now obsolete as no longer required on minimum supported Julia version 0.6. * Remove at-compat for type declarations Was added in #325, now obsolete as no longer required on minimum supported Julia version 0.6. * Remove unused at-compat helper functions * Remove README entries for removed at-compat functionality * new style call overloading (added in #181, removed in #385) * `get(io, s false)` (added in #212, #215, #225, removed in #385) * `.=` (added in #292 and #316, removed in #372) * Remove `Compat.collect(A)` Was added in #350 and #351, now obsolete as no longer required on minimum supported Julia version 0.6.
These were added in #316 for Julia versions older than 0.6. The at-dotcompat macro is kept to avoid breakage.
These were added in #316 for Julia versions older than 0.6. The at-dotcompat macro is kept to avoid breakage.
This backports the
@view
(JuliaLang/julia#16564),@views
(JuliaLang/julia#20164), and@__dot__
macros (JuliaLang/julia#20321).It also fixes the
@compat
handling of.=
when the left-hand-side is an array reference, and adds@compat
support for.+=
and similar.