From eaa1f04c59ed71e5ed437bd7ab16cc65d5e31af2 Mon Sep 17 00:00:00 2001 From: Mauro Werder Date: Tue, 4 Jul 2017 13:41:05 +0200 Subject: [PATCH] Added StepRangeLen Fixes #374 --- README.md | 4 ++++ src/Compat.jl | 6 ++++++ test/runtests.jl | 2 ++ 3 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 8228fafef..ed110bc23 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,10 @@ Currently, the `@compat` macro supports the following syntaxes: * `bytestring` has been replaced in most cases with additional `String` construction methods; for 0.4 compatibility, the usage involves replacing `bytestring(args...)` with `Compat.String(args...)`. However, for converting a `Ptr{UInt8}` to a string, use the new `unsafe_string(...)` method to make a copy or `unsafe_wrap(String, ...)` to avoid a copy. +* In 0.6, `FloatRange` was deprecated and superseded by `StepRangeLen` + [#18777]. Pre 0.6, Compat defines `const FloatRange = StepRangeLen` + and exports this. + ## New functions, macros, and methods * `@views` takes an expression and converts all slices to views ([#20164]), while diff --git a/src/Compat.jl b/src/Compat.jl index 699d77004..c6e3405a6 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -1535,4 +1535,10 @@ include("to-be-deprecated.jl") # https://github.com/JuliaLang/julia/pull/21746 const macros_have_sourceloc = VERSION >= v"0.7-" && length(:(@test).args) == 2 +# https://github.com/JuliaLang/julia/pull/18777 +if VERSION < v"0.6.0-dev.2376" + const StepRangeLen = FloatRange + export StepRangeLen +end + end # module Compat diff --git a/test/runtests.jl b/test/runtests.jl index 116780b9a..d01fafcf4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1895,4 +1895,6 @@ end include("to-be-deprecated.jl") +@test isa(1.0:5, StepRangeLen) + nothing