add at-dot, at-view, and at-views macros; improve at-compat for .= & .+=#316
add at-dot, at-view, and at-views macros; improve at-compat for .= & .+=#316
Conversation
| # 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.
@static was fine wasn't it?
There was a problem hiding this comment.
At least the CI in #304 seemed to think that @static does not exist in 0.4
There was a problem hiding this comment.
It doesn't, but it should exist in Compat
There was a problem hiding this comment.
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.
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.
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.
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
@compathandling of.=when the left-hand-side is an array reference, and adds@compatsupport for.+=and similar.