From 034a6ef22994010319301c3d449aca066f660d64 Mon Sep 17 00:00:00 2001 From: Azzaare Date: Tue, 17 Aug 2021 16:11:05 +0900 Subject: [PATCH 1/2] Fix compat with julia 1.6 --- Project.toml | 2 +- src/common.jl | 6 ++++++ src/vector.jl | 6 ------ test/Manifest.toml | 47 ---------------------------------------------- 4 files changed, 7 insertions(+), 54 deletions(-) delete mode 100644 test/Manifest.toml diff --git a/Project.toml b/Project.toml index 7885325..a45cadf 100644 --- a/Project.toml +++ b/Project.toml @@ -11,7 +11,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] Intervals = "1" Lazy = "0.15" -julia = "1.7" +julia = "1.6" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/common.jl b/src/common.jl index 8c1aa06..d95941f 100644 --- a/src/common.jl +++ b/src/common.jl @@ -111,3 +111,9 @@ end function Base.print_array(io::IO, X::AbstractVectorFold) print(io, "\tPattern: $(pattern(X))\n\tGap: $(gap(X))\n\tFolds: $(folds(X))") end + +function Base.getindex(vf::AbstractVectorFold, key) + d, r = divrem(key + 1, pattern_length(vf)) + return (d - 1) * gap(vf) + pattern(vf, r + 1) +end +Base.getindex(vf::AbstractVectorFold, key...) = map(k -> getindex(vf, k), key) diff --git a/src/vector.jl b/src/vector.jl index 52f6d46..291746f 100644 --- a/src/vector.jl +++ b/src/vector.jl @@ -95,9 +95,3 @@ function unfold(mvf::VectorFold; from=1, to=folds(mvf)) end make_vector_fold(pattern, gap, fold, ::Val{:mutable}) = VectorFold(pattern, gap, fold) - -function Base.getindex(vf::VectorFold, key) - d, r = divrem(key + 1, pattern_length(vf)) - return (d - 1) * gap(vf) + pattern(vf, r + 1) -end -Base.getindex(vf::VectorFold, key...) = map(k -> getindex(vf, k), key) diff --git a/test/Manifest.toml b/test/Manifest.toml deleted file mode 100644 index a4c0438..0000000 --- a/test/Manifest.toml +++ /dev/null @@ -1,47 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -julia_version = "1.7.0-beta3.0" -manifest_format = "2.0" - -[[deps.Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[deps.InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[deps.Lazy]] -deps = ["MacroTools"] -git-tree-sha1 = "1370f8202dac30758f3c345f9909b97f53d87d3f" -uuid = "50d2b5c4-7a5e-59d5-8109-a42b560f39c0" -version = "0.15.1" - -[[deps.Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[deps.MacroTools]] -deps = ["Markdown", "Random"] -git-tree-sha1 = "0fb723cd8c45858c22169b2e42269e53271a6df7" -uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.7" - -[[deps.Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[deps.PatternFolds]] -deps = ["Lazy"] -git-tree-sha1 = "72f03934fd8f6f5f7fe5b263b8a7ed024506a9f4" -uuid = "c18a7f1d-76ad-4ce4-950d-5419b888513b" -version = "0.1.5" - -[[deps.Random]] -deps = ["Serialization"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[deps.Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[deps.Test]] -deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From 4f5a2cc7ad0487f2fbe7a78ed5e83fefc53e0c0d Mon Sep 17 00:00:00 2001 From: Azzaare Date: Tue, 17 Aug 2021 16:13:16 +0900 Subject: [PATCH 2/2] Add 1.6 CI --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6a79e34..61a2f5b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,6 +10,7 @@ jobs: fail-fast: false matrix: version: + - "1.6" - "^1.7.0-0" - 'nightly' os: