Skip to content

Commit

Permalink
Merge pull request #289 from JuliaLang/sb/xor
Browse files Browse the repository at this point in the history
Deprecation of `$` in favour of `xor`
  • Loading branch information
simonbyrne committed Nov 14, 2016
2 parents 2534435 + e8e2ba6 commit e3f2fc9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
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

0 comments on commit e3f2fc9

Please sign in to comment.