Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation of $ in favour of xor #289

Merged
merged 2 commits into from
Nov 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ Currently, the `@compat` macro supports the following syntaxes:

* `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.

* `$` is now `xor` or `⊻` [#18977](https://github.com/JuliaLang/julia/pull/18977).

## New macros

* `@static` has been added [#16219](https://github.com/JuliaLang/julia/pull/16219).
Expand Down
7 changes: 7 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1679,4 +1679,11 @@ if VERSION < v"0.6.0-dev.848"
end
end

# julia#18977
if !isdefined(Base, :xor)
const xor = $
const ⊻ = xor
export xor, ⊻
end

end # module
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1509,3 +1509,6 @@ for T in types
x = @compat Nullable{Array{T}}()
@test_throws UndefRefError unsafe_get(x)
end

@test xor(1,5) == 4
@test 1 ⊻ 5 == 4