Skip to content

Commit 5e6c752

Browse files
committed
Add ASCII alias compose of (JuliaLang/julia#33573)
1 parent ee09e5d commit 5e6c752

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Currently, the `@compat` macro supports the following syntaxes:
6363

6464
* `merge` methods with one and `n` `NamedTuple`s ([#29259]).
6565

66+
* Function composition `` now has an ASCII alias `compose` ([#33573]).
67+
6668
## Renaming
6769

6870
## New macros
@@ -131,3 +133,4 @@ includes this fix. Find the minimum version from there.
131133
[#32628]: https://github.com/JuliaLang/julia/issues/32628
132134
[#33129]: https://github.com/JuliaLang/julia/issues/33129
133135
[#33568]: https://github.com/JuliaLang/julia/pull/33568
136+
[#33573]: https://github.com/JuliaLang/julia/pull/33573

src/Compat.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ if VERSION < v"1.4.0-DEV.329"
9393
Base.:(f, g, h...) = (f g, h...)
9494
end
9595

96+
# https://github.com/JuliaLang/julia/pull/33573
97+
if VERSION < v"1.4.0-DEV.330"
98+
export compose
99+
const compose =
100+
end
101+
96102
include("deprecated.jl")
97103

98104
end # module Compat

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ end
9191
end
9292

9393
# https://github.com/JuliaLang/julia/pull/33568
94+
# https://github.com/JuliaLang/julia/pull/33573
9495
@testset "function composition" begin
9596
@test (x -> x-2, x -> x-3, x -> x+5)(7) == 7
9697
fs = [x -> x[1:2], uppercase, lowercase]
9798
@test (fs...)("ABC") == "AB"
99+
@test (fs...) === compose(fs...)
98100
end
99101

100102
nothing

0 commit comments

Comments
 (0)