diff --git a/README.md b/README.md index 0b1a801d4..113cee93e 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,9 @@ Currently, the `@compat` macro supports the following syntaxes: ## Other changes +* Function composition now supports multiple functions: `∘(f, g, h) = f ∘ g ∘ h` + and splatting `∘(fs...)` for composing an iterable collection of functions ([#33568]). + ## New types ## Developer tips @@ -127,3 +130,4 @@ includes this fix. Find the minimum version from there. [#29749]: https://github.com/JuliaLang/julia/issues/29749 [#32628]: https://github.com/JuliaLang/julia/issues/32628 [#33129]: https://github.com/JuliaLang/julia/issues/33129 +[#33568]: https://github.com/JuliaLang/julia/pull/33568 diff --git a/src/Compat.jl b/src/Compat.jl index e9d2d2fb6..e4946a6d2 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -88,6 +88,11 @@ if VERSION < v"1.3.0-alpha.8" Base.mod(i::Integer, r::AbstractUnitRange{<:Integer}) = mod(i-first(r), length(r)) + first(r) end +# https://github.com/JuliaLang/julia/pull/33568 +if VERSION < v"1.4.0-DEV.329" + Base.:∘(f, g, h...) = ∘(f ∘ g, h...) +end + include("deprecated.jl") end # module Compat