ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name  #><  for bit-wise "exclusive or"
@ 2012-11-10 11:26 alexeymuranov (Alexey Muranov)
  2012-11-10 19:51 ` [ruby-core:49204] " Nathan Broadbent
                   ` (15 more replies)
  0 siblings, 16 replies; 18+ messages in thread
From: alexeymuranov (Alexey Muranov) @ 2012-11-10 11:26 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been reported by alexeymuranov (Alexey Muranov).

----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322

Author: alexeymuranov (Alexey Muranov)
Status: Open
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49204] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
@ 2012-11-10 19:51 ` Nathan Broadbent
  2012-11-12 15:19 ` [ruby-core:49257] [ruby-trunk - Feature #7322] " alexeymuranov (Alexey Muranov)
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Nathan Broadbent @ 2012-11-10 19:51 UTC (permalink / raw
  To: ruby-core@ruby-lang.org

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

> "a^n" usually means "the n-th power of a"

I agree, I think using "^" for exponents would be more consistent with
other languages. I don't have a strong opinion on a replacement for
'exclusive or', but some other approximations of "⊻"  could be: "|<" or
"/<".

[-- Attachment #2: Type: text/html, Size: 501 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49257] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
  2012-11-10 19:51 ` [ruby-core:49204] " Nathan Broadbent
@ 2012-11-12 15:19 ` alexeymuranov (Alexey Muranov)
  2012-11-15 17:56 ` [ruby-core:49386] " trans (Thomas Sawyer)
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: alexeymuranov (Alexey Muranov) @ 2012-11-12 15:19 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by alexeymuranov (Alexey Muranov).


Related: #6678.
----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32817

Author: alexeymuranov (Alexey Muranov)
Status: Open
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49386] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
  2012-11-10 19:51 ` [ruby-core:49204] " Nathan Broadbent
  2012-11-12 15:19 ` [ruby-core:49257] [ruby-trunk - Feature #7322] " alexeymuranov (Alexey Muranov)
@ 2012-11-15 17:56 ` trans (Thomas Sawyer)
  2012-11-15 23:26 ` [ruby-core:49398] [ruby-trunk - Feature #7322][Rejected] " matz (Yukihiro Matsumoto)
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: trans (Thomas Sawyer) @ 2012-11-15 17:56 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by trans (Thomas Sawyer).


Given the rejection of #7336, I would ask this this issue be more seriously considered. Personally, I don't really care if #^ continues to mean bitwise xor for numerics, but at least raise its precedence to be the same as #**, and provide an alternative xor operator with the present precedence. Whether `#><` is a good choice or not, I am mostly indifferent. (I suppose alternatives might be `#~` or `#!` which are unary operators, but have no binary definition.)

----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32936

Author: alexeymuranov (Alexey Muranov)
Status: Open
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49398] [ruby-trunk - Feature #7322][Rejected] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (2 preceding siblings ...)
  2012-11-15 17:56 ` [ruby-core:49386] " trans (Thomas Sawyer)
@ 2012-11-15 23:26 ` matz (Yukihiro Matsumoto)
  2012-11-15 23:41 ` [ruby-core:49399] [ruby-trunk - Feature #7322] " david_macmahon (David MacMahon)
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: matz (Yukihiro Matsumoto) @ 2012-11-15 23:26 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by matz (Yukihiro Matsumoto).

Status changed from Open to Rejected

So what's your intention?  To make '^' a power operator, and ruin innocent programs? Because you feel "natural"?
If Ruby were young and there were no (or few) Ruby programs out there, your proposal might be useful.
But I don't want to break compatibility for fashion.
"When in Rome, do as the Romans do".

Matz.

----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32945

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49399] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (3 preceding siblings ...)
  2012-11-15 23:26 ` [ruby-core:49398] [ruby-trunk - Feature #7322][Rejected] " matz (Yukihiro Matsumoto)
@ 2012-11-15 23:41 ` david_macmahon (David MacMahon)
  2012-11-16  0:35 ` [ruby-core:49401] " trans (Thomas Sawyer)
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: david_macmahon (David MacMahon) @ 2012-11-15 23:41 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by david_macmahon (David MacMahon).


I fully agree that repurposing '^' to be a power operator is not a good idea.

One alternative idea that might not make anyone happy would be to create a new power operator "^^" that is the same as "**", but seems more like exponentiation to those too young to know (or too old to remember :-)) Fortran.

Please feel free to ignore this suggestion,
Dave

----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32946

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49401] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (4 preceding siblings ...)
  2012-11-15 23:41 ` [ruby-core:49399] [ruby-trunk - Feature #7322] " david_macmahon (David MacMahon)
@ 2012-11-16  0:35 ` trans (Thomas Sawyer)
  2012-11-16  1:02 ` [ruby-core:49402] " matz (Yukihiro Matsumoto)
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: trans (Thomas Sawyer) @ 2012-11-16  0:35 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by trans (Thomas Sawyer).


@matz Have you ever read about issue I have with implementing Stick b/c of this? I have no Rome to be in. I am in Carthage!

@dvaid_macmahon Well, #^^ would be better than nothing.

----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32948

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49402] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (5 preceding siblings ...)
  2012-11-16  0:35 ` [ruby-core:49401] " trans (Thomas Sawyer)
@ 2012-11-16  1:02 ` matz (Yukihiro Matsumoto)
  2012-11-16 15:00 ` [ruby-core:49424] " alexeymuranov (Alexey Muranov)
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: matz (Yukihiro Matsumoto) @ 2012-11-16  1:02 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by matz (Yukihiro Matsumoto).


No. There are so many "issues" out there. I don't have time to check them all.
Reference please.

Matz.

----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32949

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49424] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (6 preceding siblings ...)
  2012-11-16  1:02 ` [ruby-core:49402] " matz (Yukihiro Matsumoto)
@ 2012-11-16 15:00 ` alexeymuranov (Alexey Muranov)
  2012-11-16 16:29 ` [ruby-core:49438] " trans (Thomas Sawyer)
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: alexeymuranov (Alexey Muranov) @ 2012-11-16 15:00 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by alexeymuranov (Alexey Muranov).


Speaking of Fortran, there the binary `*` has higher precedence than the unary `-`, which has approximately the same as the binary one.  (This is not about this issue, but about #7328 and #7331.)

I would way it is unfortunate that the main reason to reject it that Ruby is too old to change.  (The changes would not need to be immediate, i think that aliases can be introduced or deprecated between major versions.)  But i am not a heavy Ruby user, i was only proposing my ideas hoping that they could be useful for others too.
----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32963

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49438] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (7 preceding siblings ...)
  2012-11-16 15:00 ` [ruby-core:49424] " alexeymuranov (Alexey Muranov)
@ 2012-11-16 16:29 ` trans (Thomas Sawyer)
  2012-11-16 17:29 ` [ruby-core:49446] " stomar (Marcus Stollsteimer)
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: trans (Thomas Sawyer) @ 2012-11-16 16:29 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by trans (Thomas Sawyer).


=begin
@matz

Reference given below[1], but I can give very brief summary to save you time...

Stick is an SI units system for Ruby. While in pure math there is just one type of "power" (in Ruby provided by (({#**}))), in physical systems there is also units and units themselves can have "power", e.g. cubic meters. So any good units system therefore ((*needs two power operators*)), one for the value and one for the unit. The natural notation for these are, e.g.

    10.m**3   (10 meters * 10 meters * 10 meters)
    10.m^3    (10 cubic meters)

But precedence of (({#^})) is too low in Ruby to do this well, e.g.

    10.m^2/2  => 10 meters, instead of 5.m^2

Nor is there some alternative operator to utilize.

Unit powers is a common real word application, so I think it is not unreasonable to seek that Ruby be able to accommodate such a use case.

In short, for me to create the best SI units system I can for Ruby, I need another power operator.

[1] https://github.com/trans/trans.github.com/wiki/2009-12-13-a-failure-of-precedence
=end

----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32975

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49446] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (8 preceding siblings ...)
  2012-11-16 16:29 ` [ruby-core:49438] " trans (Thomas Sawyer)
@ 2012-11-16 17:29 ` stomar (Marcus Stollsteimer)
  2012-11-16 17:57 ` [ruby-core:49449] " alexeymuranov (Alexey Muranov)
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: stomar (Marcus Stollsteimer) @ 2012-11-16 17:29 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by stomar (Marcus Stollsteimer).


@trans

There is only one type of power operator in physics.
You would have to use parentheses:

  (10 m)^3   (10 meters * 10 meters * 10 meters)
  10 m^3     (10 cubic meters)

And I think you should also have to use them in the code.

From a physicist's point of view, I find the idea of distinguishing between different kinds of power operators strange at best, probably confusing to the user and maybe even dangerous.

----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32983

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49449] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (9 preceding siblings ...)
  2012-11-16 17:29 ` [ruby-core:49446] " stomar (Marcus Stollsteimer)
@ 2012-11-16 17:57 ` alexeymuranov (Alexey Muranov)
  2012-11-16 18:12 ` [ruby-core:49450] " trans (Thomas Sawyer)
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: alexeymuranov (Alexey Muranov) @ 2012-11-16 17:57 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by alexeymuranov (Alexey Muranov).


Thomas, i agree with @stomar.
----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32986

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49450] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (10 preceding siblings ...)
  2012-11-16 17:57 ` [ruby-core:49449] " alexeymuranov (Alexey Muranov)
@ 2012-11-16 18:12 ` trans (Thomas Sawyer)
  2012-11-16 18:34   ` [ruby-core:49453] " Clay Trump
  2012-11-16 18:41 ` [ruby-core:49454] " stomar (Marcus Stollsteimer)
                   ` (3 subsequent siblings)
  15 siblings, 1 reply; 18+ messages in thread
From: trans (Thomas Sawyer) @ 2012-11-16 18:12 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by trans (Thomas Sawyer).


=begin
@stomer

Yes and no. The problem is in the Ruby notation. In physics, you can use parenthesis to make the distinction, but you can't in Ruby. e.g. Your example doesn't work in Ruby:

  10.m**3

and

  (10.m)**3

Can only produce the same result.
=end

----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32987

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49453] Re: [ruby-trunk - Feature #7322] Add a new operator name #>< for bit-wise "exclusive or"
  2012-11-16 18:12 ` [ruby-core:49450] " trans (Thomas Sawyer)
@ 2012-11-16 18:34   ` Clay Trump
  0 siblings, 0 replies; 18+ messages in thread
From: Clay Trump @ 2012-11-16 18:34 UTC (permalink / raw
  To: ruby-core

[-- Attachment #1: Type: text/plain, Size: 120 bytes --]

Sorry, I didn't read the whole thread, but why not use the right operators?

    g = 9.81 * m / s ** 2

-- 
<lay trum/>

[-- Attachment #2: Type: text/html, Size: 504 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49454] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (11 preceding siblings ...)
  2012-11-16 18:12 ` [ruby-core:49450] " trans (Thomas Sawyer)
@ 2012-11-16 18:41 ` stomar (Marcus Stollsteimer)
  2012-11-17  9:54 ` [ruby-core:49481] " trans (Thomas Sawyer)
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: stomar (Marcus Stollsteimer) @ 2012-11-16 18:41 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by stomar (Marcus Stollsteimer).


=begin
@trans

Imo the point is that using a method for the unit does not correctly model the mathematical relation (and hence the precedence) between the numerical value of the physical quantity and its unit, which simply is a multiplication.

Just a thought: how about using an argument for the power of the unit, like in

  10.m**3  # (10 m)^3
  10.m(3)  # 10 m^3

But this is taking a very off-topic direction...
=end

----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-32989

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49481] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (12 preceding siblings ...)
  2012-11-16 18:41 ` [ruby-core:49454] " stomar (Marcus Stollsteimer)
@ 2012-11-17  9:54 ` trans (Thomas Sawyer)
  2012-11-17 10:01 ` [ruby-core:49482] " trans (Thomas Sawyer)
  2012-11-17 10:24 ` [ruby-core:49486] " alexeymuranov (Alexey Muranov)
  15 siblings, 0 replies; 18+ messages in thread
From: trans (Thomas Sawyer) @ 2012-11-17  9:54 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by trans (Thomas Sawyer).


=begin
It might seem like it, but designating a unit is not multiplication.

(({9.81 * m})) actually means (({9.81 * 1 m}))

Implementation wise this approach is a bit messier too. It requires overriding the built-in #* method and adding a slew of type methods to Object (e.g. Object#m).

@stomer Using an argument for the unit power isn't a skeuomorphic ideal. But it might suffice. I need to give it some thought and take a look at the Stick code to make sure. I'll try to do that today and report back. Thanks.

Speaking of a skeuomorphic ideal, do you notice that in general contexts when people give ascii examples of "power" they always use (({^}))? I don't really understand why language designers are so bent on bucking the overwhelming commonality of this choice --all solely to cling to C's tradition of using (({^})) as XOR? How unfortunate. But anyway, I digress.
=end
----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-33012

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49482] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (13 preceding siblings ...)
  2012-11-17  9:54 ` [ruby-core:49481] " trans (Thomas Sawyer)
@ 2012-11-17 10:01 ` trans (Thomas Sawyer)
  2012-11-17 10:24 ` [ruby-core:49486] " alexeymuranov (Alexey Muranov)
  15 siblings, 0 replies; 18+ messages in thread
From: trans (Thomas Sawyer) @ 2012-11-17 10:01 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by trans (Thomas Sawyer).


Hmm... "skeuomorphic" probably isn't really the right word actually. I really meant something more like "reflecting reality". In this case, specifically, "best reflecting common mathematical notation". 
----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-33013

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [ruby-core:49486] [ruby-trunk - Feature #7322] Add a new operator name  #><  for bit-wise "exclusive or"
  2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
                   ` (14 preceding siblings ...)
  2012-11-17 10:01 ` [ruby-core:49482] " trans (Thomas Sawyer)
@ 2012-11-17 10:24 ` alexeymuranov (Alexey Muranov)
  15 siblings, 0 replies; 18+ messages in thread
From: alexeymuranov (Alexey Muranov) @ 2012-11-17 10:24 UTC (permalink / raw
  To: ruby-core


Issue #7322 has been updated by alexeymuranov (Alexey Muranov).


Thomas, let some physicist correct me, but i thought that designating units was multiplication: 9.81 m/s^2 = (9.81 * m)/(s^2).  This should however be discussed in a different thread. :)
----------------------------------------
Feature #7322: Add a new operator name  #><  for bit-wise "exclusive or"
https://bugs.ruby-lang.org/issues/7322#change-33017

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Low
Assignee: 
Category: 
Target version: 


=begin
I propose to alias (({Fixnum#^})) and (({Bignum#^})), which stand for bit-wise "exclusive or", with a new operator name (({#><})).

Is it necessary to go along with C, Python, and Mathematica?
According to Wikipedia ( http://en.wikipedia.org/wiki/Exclusive_or#Alternative_symbols ), the "^" symbol is not used for XOR outside of programming context.

Here are some examples of mathematical notation: http://mathworld.wolfram.com/XOR.html (there are also examples in the Wikipedia article).

The Unicode symbol is "⊻".

If eventually (({Fixnum#^})) as XOR is deprecated, this will liberate this symbol for other uses, for example for all kinds of exponential notations (for me, "a^n" usually means "the n-th power of a").
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-11-17 10:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-10 11:26 [ruby-core:49196] [ruby-trunk - Feature #7322][Open] Add a new operator name #>< for bit-wise "exclusive or" alexeymuranov (Alexey Muranov)
2012-11-10 19:51 ` [ruby-core:49204] " Nathan Broadbent
2012-11-12 15:19 ` [ruby-core:49257] [ruby-trunk - Feature #7322] " alexeymuranov (Alexey Muranov)
2012-11-15 17:56 ` [ruby-core:49386] " trans (Thomas Sawyer)
2012-11-15 23:26 ` [ruby-core:49398] [ruby-trunk - Feature #7322][Rejected] " matz (Yukihiro Matsumoto)
2012-11-15 23:41 ` [ruby-core:49399] [ruby-trunk - Feature #7322] " david_macmahon (David MacMahon)
2012-11-16  0:35 ` [ruby-core:49401] " trans (Thomas Sawyer)
2012-11-16  1:02 ` [ruby-core:49402] " matz (Yukihiro Matsumoto)
2012-11-16 15:00 ` [ruby-core:49424] " alexeymuranov (Alexey Muranov)
2012-11-16 16:29 ` [ruby-core:49438] " trans (Thomas Sawyer)
2012-11-16 17:29 ` [ruby-core:49446] " stomar (Marcus Stollsteimer)
2012-11-16 17:57 ` [ruby-core:49449] " alexeymuranov (Alexey Muranov)
2012-11-16 18:12 ` [ruby-core:49450] " trans (Thomas Sawyer)
2012-11-16 18:34   ` [ruby-core:49453] " Clay Trump
2012-11-16 18:41 ` [ruby-core:49454] " stomar (Marcus Stollsteimer)
2012-11-17  9:54 ` [ruby-core:49481] " trans (Thomas Sawyer)
2012-11-17 10:01 ` [ruby-core:49482] " trans (Thomas Sawyer)
2012-11-17 10:24 ` [ruby-core:49486] " alexeymuranov (Alexey Muranov)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).