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

Deprecation of $ in favour of xor #289

merged 2 commits into from
Nov 14, 2016

Conversation

simonbyrne
Copy link
Contributor

@nalimilan
Copy link
Member

Could you add a test?

@simonbyrne simonbyrne merged commit e3f2fc9 into master Nov 14, 2016
@simonbyrne simonbyrne deleted the sb/xor branch November 14, 2016 14:22
@GunnarFarneback
Copy link

This doesn't cover ⊻=. Is it at all possible to support that with Compat?

julia> using Compat

julia> x = true
true

julia> x $= true
false

julia> x ⊻= true
ERROR: syntax: unexpected "="

@stevengj
Copy link
Member

stevengj commented Jul 10, 2017

No, ⊻= isn't parsed as an operator in 0.5. You have to write x = x ⊻ true

@GunnarFarneback
Copy link

Ok. That's a bit unfortunate for the specific piece of code I'm working with since ⊻= will look nicer once 0.5 support can be dropped.

In case someone else should run into this, this is the alternative solution I chose for the 0.5 to 0.6 transition (skipping Compat):

if isdefined(:xor)
    macro x(ex)
        arg1 = ex.args[1]
        arg2 = ex.args[2]
        return esc(:($(arg1) = $(arg1) ⊻ $(arg2)))
    end
else
    const ⊻ = $
    macro x(ex)
        return esc(ex)
    end
end

and decorating all use of $= with the @x macro.

martinholters added a commit that referenced this pull request Aug 31, 2018
martinholters added a commit that referenced this pull request Aug 31, 2018
stevengj pushed a commit that referenced this pull request Sep 5, 2018
* Remove `take!(::Task)` definition for Julia versions prior to 0.6

Was added in #307.

* Remove `redirect_std*(f, stream)` definitions for Julia prior to v0.6

Were added in #275.

* Remove at-__DIR__ macro definition for Julia versions prior to 0.6

Was added in #281.

* Remove `broadcast` definition for equal-length tuples

Was added in #324 and #328

* Remove definitions of `unsafe_get` and `isnull` fallsback

Were added in #287.

* Remove defintions of `xor` and `⊻`

Were added in #289.

* Definitions of `numerator` and `denominator`

Were added in #290.

* Remove defintion of `iszero`

Was added in #305.

* Remove definition of `>:`

Was added in #336

* Remove definition of `take!(::Base.AbstractIOBuffer)`

Was added in #290.

* Remove definiton of `.&` and `.|`

Were added in #306.

* Remove definition of `Compat.isapprox`

Was added in #309.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants