Skip to content

Commit e3f2fc9

Browse files
authored
Merge pull request JuliaLang#289 from JuliaLang/sb/xor
Deprecation of `$` in favour of `xor`
2 parents 2534435 + e8e2ba6 commit e3f2fc9

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ Currently, the `@compat` macro supports the following syntaxes:
124124

125125
* `writemime` has been merged into `show` [#16563](https://github.com/JuliaLang/julia/pull/16563). Note that to extend this function requires `@compat`; see the [Supported Syntax](#supported-syntax) section for more information.
126126

127+
* `$` is now `xor` or `` [#18977](https://github.com/JuliaLang/julia/pull/18977).
128+
127129
## New macros
128130

129131
* `@static` has been added [#16219](https://github.com/JuliaLang/julia/pull/16219).

src/Compat.jl

+7
Original file line numberDiff line numberDiff line change
@@ -1679,4 +1679,11 @@ if VERSION < v"0.6.0-dev.848"
16791679
end
16801680
end
16811681

1682+
# julia#18977
1683+
if !isdefined(Base, :xor)
1684+
const xor = $
1685+
const = xor
1686+
export xor,
1687+
end
1688+
16821689
end # module

test/runtests.jl

+3
Original file line numberDiff line numberDiff line change
@@ -1509,3 +1509,6 @@ for T in types
15091509
x = @compat Nullable{Array{T}}()
15101510
@test_throws UndefRefError unsafe_get(x)
15111511
end
1512+
1513+
@test xor(1,5) == 4
1514+
@test 1 5 == 4

0 commit comments

Comments
 (0)