-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Deprecate $
as bitwise exclusive or to free ascii-char $
for more useful purpose
#18696
Comments
If we want I don't think it would be a good idea to use That being said, I'm inclined to agree that xor is uncommon enough that there's no need to define an ASCII binary operator for it. We could just use |
I agree this is a waste of an ASCII operator. I might even extend the argument to
|
(not a coincidence, this is Curry-Howard :-)) |
|
not entirely as is, we should deprecate the vectorized |
👎 to using |
I figured that, I just thought that |
Did someone say Unicode? ⊻ is not defined... I edited the OP to reflect the discussion of |
Here's my position:
|
Sounds like it is resolved to deprecate |
Great! Will anyone pick this up or should I dig into the code and try to submit a PR? |
I'd like to maintain having infix operators for all bitwise operations. Using a unicode operator such as ⊻ or ⊕ ( |
Alternatively, since bitwise operators aren't used very frequently we could always use a macro and stick to the traditional C bitwise operators. @bitwise a ^ b # XOR
a ^ b # Exponentiation I could also see this leading to confusion. Just a thought. |
I'm ok with ⊻ ( |
Yes, |
+100 to the use of |
The reason you're getting some thumbs down is that people would prefer to have |
I originally wanted |
So, then Base would define something along the lines of
if |
@davidavdav, see the discussion in #1974 and the attempted implementation in #5848; further discussion of |
This includes: - occurrances of $ (as operator) and $= in base - occurances of $ in test - the definition in the manual - the entry in REPL help This patch passes `make test`.
This includes: - occurrances of $ (as infix operator) and $= in base - occurances of $ in test - the definition in the manual - the entry in REPL help This commit does not introduce an alternative, that will happen in the next commit.
This includes: - occurrances of $ (as infix operator) and $= in base - occurances of $ in test - the definition in the manual - the entry in REPL help This commit does not introduce an alternative, that will happen in the next commit.
This includes: - occurrances of $ (as infix operator) and $= in base - occurances of $ in test - the definition in the manual - the entry in REPL help This commit does not introduce an alternative, that will happen in the next commit.
This includes: - occurrances of $ (as infix operator) and $= in base - occurances of $ in test - the definition in the manual - the entry in REPL help This commit does not introduce an alternative, that will happen in the next commit.
#18977) * Deprecate $ for xor() (#18696) This includes: - occurrances of $ (as infix operator) and $= in base - occurances of $ in test - the definition in the manual - the entry in REPL help This commit does not introduce an alternative, that will happen in the next commit. * Add ⊻ as alternative to xor, and `⊻=` as alternative to `$=`. Please note that `⊻=` is in the add-dots group in the parser, preparing for `.⊻=`. However, this commit does not implement `.⊻` yet, this should happen in a separate commit with `.&` and `.|` together. * Add deprecation comment in show.jl and deprecation item in NEWS.md
…Lang#18696 (JuliaLang#18977) * Deprecate $ for xor() (JuliaLang#18696) This includes: - occurrances of $ (as infix operator) and $= in base - occurances of $ in test - the definition in the manual - the entry in REPL help This commit does not introduce an alternative, that will happen in the next commit. * Add ⊻ as alternative to xor, and `⊻=` as alternative to `$=`. Please note that `⊻=` is in the add-dots group in the parser, preparing for `.⊻=`. However, this commit does not implement `.⊻` yet, this should happen in a separate commit with `.&` and `.|` together. * Add deprecation comment in show.jl and deprecation item in NEWS.md
I know, I am late in the party... Still, a standardized (extended) ASCII character for infix bitwise and Boolean XOR would be nice. The reasons:
I tried to use the currency symbol for XOR: ¤. Other good candidates could be ¢, ¥, §, ©, ®, ¶... |
None of the characters you propose are ASCII; I guess you mean Latin1? The world in which you can use Latin1 but not Unicode is quickly becoming a memory... |
This is what I meant with "extended" ASCII. I don't know, if multiple code pages have identical symbols. If anything is common, we might be able to use that. |
Unicode turned the whole concept of "code pages" into a relic. Only one "code page" is allowed for Julia code, and that is UTF-8. I agree that the shortcomings of the default Windows terminal (inadequate fonts being the least of them) is a persistent problem. It may be that we will simply have to bundle a better terminal on Windows; see #7267. |
As I tried to discuss here I believe that
$
is a waste of single ascii character operator space.xor()
would probably read just as easy. (Unfortunately, the discussion quickly derailed towards the concatenation operator*
for strings).I think in the mean time
$
is dispatched for more types than just(Bool, Bool)
, which is rather unfortunate.For[@jiahao: edited from discussion below;Bool
types, the operator could be replaced by^
. (Currentlyx::Bool ^ y::Bool
has the semantics of "y
impliesx
", which was not intended IMHO).^
is exponentiation]It would be great to have
$
free/deprecated before julia-0.6/1.0 is finalised. My personal favourite is thatx$y
is, somehow, interpreted asx[:y]
. See also the the discussion at #1974 .The text was updated successfully, but these errors were encountered: