Skip to content

Commit

Permalink
Merge branch 'master' into aa/more-0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre authored Jan 3, 2018
2 parents e450796 + 7a92e17 commit eb60a6a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ Currently, the `@compat` macro supports the following syntaxes:

* `Void` is now `Nothing` with an alias `Cvoid` for C interop ([#25162]).

* `unshift!` and `shift!` are now `pushfirst!` and `popfirst!` ([#25100]).

* `ipermute!` is now `invpermute!` ([#25168]).

## New macros
Expand Down Expand Up @@ -424,6 +426,7 @@ includes this fix. Find the minimum version from there.
[#25021]: https://github.com/JuliaLang/julia/issues/25021
[#25056]: https://github.com/JuliaLang/julia/issues/25056
[#25057]: https://github.com/JuliaLang/julia/issues/25057
[#25100]: https://github.com/JuliaLang/julia/issues/25100
[#25102]: https://github.com/JuliaLang/julia/issues/25102
[#25162]: https://github.com/JuliaLang/julia/issues/25162
[#25165]: https://github.com/JuliaLang/julia/issues/25165
Expand Down
7 changes: 7 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,13 @@ else
import Base: notnothing
end

# 0.7.0-DEV.3155
@static if !isdefined(Base, :pushfirst!)
const pushfirst! = unshift!
const popfirst! = shift!
export pushfirst!, popfirst!
end

# 0.7.0-DEV.3173
@static if !isdefined(Base, :invpermute!)
const invpermute! = ipermute!
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,12 @@ end
@test Compat.notnothing(1) == 1
@test_throws ArgumentError Compat.notnothing(nothing)

# 0.7.0-DEV.3155
let coolvec = [1,2,3]
@test pushfirst!(coolvec, 0) == [0,1,2,3]
@test popfirst!(coolvec) == 0
end

# 0.7.0-DEV.3173
@test invpermute!(permute!([1, 2], 2:-1:1), 2:-1:1) == [1, 2]

Expand Down

0 comments on commit eb60a6a

Please sign in to comment.