From b65b72fee813828dd8328e33cc35a5336ca0243e Mon Sep 17 00:00:00 2001 From: Shan Sikdar Date: Tue, 4 Feb 2020 19:03:12 -0500 Subject: [PATCH 1/6] add to Compat for Julia PR 34652 --- Project.toml | 2 +- README.md | 3 +++ src/Compat.jl | 6 ++++++ test/runtests.jl | 6 ++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 45fc353d4..342038680 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Compat" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "3.2.0" +version = "3.2.1" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/README.md b/README.md index 6f08ca9e1..bebdccd7c 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,8 @@ Please check the list below for the specific syntax you need. * `range` supporting `stop` as positional argument ([#28708]). (since Compat 1.3.0) +* `ismutable` support ([#34652]). (since Compat 3.2.1) + ## Developer tips One of the most important rules for `Compat.jl` is to avoid breaking user code @@ -112,3 +114,4 @@ Note that you should specify the correct minimum version for `Compat` in the [#33128]: https://github.com/JuliaLang/julia/pull/33128 [#33736]: http://github.com/JuliaLang/julia/pull/33736 [#32968]: https://github.com/JuliaLang/julia/pull/32968 +[#34652]: https://github.com/JuliaLang/julia/pull/34652 diff --git a/src/Compat.jl b/src/Compat.jl index aa8f1dbcf..5496f3bf0 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -199,6 +199,12 @@ if VERSION < v"1.4.0-DEV.551" Base.filter(f, t::Base.Any16) = Tuple(filter(f, collect(t))) end +# https://github.com/JuliaLang/julia/pull/34652 +if VERSION < v"1.5.0-DEV.231" + export ismutable + ismutable(@nospecialize(x)) = (@_pure_meta; typeof(x).mutable) +end + include("deprecated.jl") end # module Compat diff --git a/test/runtests.jl b/test/runtests.jl index 256f51673..53ed30dd2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -214,4 +214,10 @@ end @test filter(x -> x<2, (longtuple..., 1.5)) === (1, 1.5) end +# https://github.com/JuliaLang/julia/pull/34652 +@testset "ismutable" being + @test ismutable(1) == false + @test ismutable([]) == true +end + nothing From 6e4a95cc1a9e725a6b67d6c22ae6b60a3077f180 Mon Sep 17 00:00:00 2001 From: Shan Sikdar Date: Tue, 4 Feb 2020 19:31:22 -0500 Subject: [PATCH 2/6] change @_pure_meta to Base.@_pure_meta --- src/Compat.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compat.jl b/src/Compat.jl index 5496f3bf0..311069d37 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -202,7 +202,7 @@ end # https://github.com/JuliaLang/julia/pull/34652 if VERSION < v"1.5.0-DEV.231" export ismutable - ismutable(@nospecialize(x)) = (@_pure_meta; typeof(x).mutable) + ismutable(@nospecialize(x)) = (Base.@_pure_meta; typeof(x).mutable) end include("deprecated.jl") From 143d12157b66d74c9f1de814a2294b9db0468cb4 Mon Sep 17 00:00:00 2001 From: Shan Sikdar Date: Tue, 4 Feb 2020 19:36:19 -0500 Subject: [PATCH 3/6] fix typo --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 53ed30dd2..e70d8a6dd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -215,7 +215,7 @@ end end # https://github.com/JuliaLang/julia/pull/34652 -@testset "ismutable" being +@testset "ismutable" begin @test ismutable(1) == false @test ismutable([]) == true end From 31f1530acc298786306509204d6a6f6bb4901e39 Mon Sep 17 00:00:00 2001 From: Shan Sikdar Date: Thu, 6 Feb 2020 13:59:55 -0500 Subject: [PATCH 4/6] change per code review --- Project.toml | 2 +- README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 342038680..81b735828 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Compat" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "3.2.1" +version = "3.4.0" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/README.md b/README.md index bebdccd7c..5894f1e7e 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ Please check the list below for the specific syntax you need. ## Supported features +* `ismutable` return `true` iff value `v` is mutable ([#34652]). (since Compat 3.4.0) + * `dot` now has a 3-argument method `dot(x, A, y)` without storing the intermediate result `A*y` ([#32739]). (since Compat 3.2.0) * `pkgdir(m)` returns the root directory of the package that imported module `m` ([#33128]). (since Compat 3.2.0) @@ -70,7 +72,6 @@ Please check the list below for the specific syntax you need. * `range` supporting `stop` as positional argument ([#28708]). (since Compat 1.3.0) -* `ismutable` support ([#34652]). (since Compat 3.2.1) ## Developer tips From 02896167378af89df27a5239af983f13b0952ce0 Mon Sep 17 00:00:00 2001 From: Shan Sikdar Date: Sat, 8 Feb 2020 10:20:03 -0500 Subject: [PATCH 5/6] change version to version after ismutable went into julia master --- src/Compat.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compat.jl b/src/Compat.jl index 311069d37..376c65974 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -200,7 +200,7 @@ if VERSION < v"1.4.0-DEV.551" end # https://github.com/JuliaLang/julia/pull/34652 -if VERSION < v"1.5.0-DEV.231" +if VERSION < v"1.5.0-DEV.236" export ismutable ismutable(@nospecialize(x)) = (Base.@_pure_meta; typeof(x).mutable) end From c8403f9cb759206c6c3b15c64f92e958e32b293f Mon Sep 17 00:00:00 2001 From: Shan Sikdar Date: Sat, 8 Feb 2020 18:30:48 -0500 Subject: [PATCH 6/6] code review --- Project.toml | 1 - src/Compat.jl | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 84245a75e..81b735828 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,6 @@ name = "Compat" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" version = "3.4.0" - [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/Compat.jl b/src/Compat.jl index b452660df..1fab80e85 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -200,7 +200,7 @@ if VERSION < v"1.4.0-DEV.551" end # https://github.com/JuliaLang/julia/pull/34652 -if VERSION < v"1.5.0-DEV.236" +if VERSION < v"1.5.0-DEV.247" export ismutable ismutable(@nospecialize(x)) = (Base.@_pure_meta; typeof(x).mutable) end