From: "yhara (Yutaka HARA)" Date: 2012-10-25T19:22:18+09:00 Subject: [ruby-core:48253] [ruby-trunk - Feature #6678] Precedence of ^ operator Issue #6678 has been updated by yhara (Yutaka HARA). Target version changed from 2.0.0 to Next Major ---------------------------------------- Feature #6678: Precedence of ^ operator https://bugs.ruby-lang.org/issues/6678#change-31531 Author: trans (Thomas Sawyer) Status: Open Priority: Normal Assignee: Category: core Target version: Next Major I wrote about this here: http://trans.github.com/2009/12/13/a-failure-of-precedence.html (or https://github.com/trans/trans.github.com/wiki/2009-12-13-a-failure-of-precedence if you prefer) In short I would like to see `^` operator move up in precedence to be the same as `**`. We need another option besides `**` at the top of precedence list and `^` fits the bill well since many languages already think of it as "power of". Of course, this has downside that effects current use for XOR definition. A new operator would be needed for that but `^` could alias it by default, so only thing that changes is precedence. Thankfully XOR is not among the most commonly used operators and often when used the precedence will be okay either way. So there should be very few cases where new operator or parenthesis will need to be put in. Ultimately it would be great if precedence could be controlled on per-class basis. But that is big change, and might not be altogether practical. So I propose this one modest adjustment instead in which it would be an improvement. -- http://bugs.ruby-lang.org/