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

"you can always use parentheses if needed"

Unfortunately it is very unnatural for a unit system. Let me give an example to explain. In Stick, the obvious DSL is:

10.meters**2  => 100m
10.meters^2   => 10m^2

So, ** is power on the value and ^ is used to indicate power of the unit.

But the precedence of ^ is a problem.

10.meters^2 / 2  => 10m

Rather then the `5m^2` expected. While parenthesis can be used, it so unnatural to this common notation that it puts a rather ugly black mark on creating a nice SI units system for Ruby at all.

This particular problem could easily be solved by raising the precedence of ^ to that of **, which is why I suggested #6678 first --although that feels more like a band-aid. Controllable precedence feels like the right solution to me b/c others may ultimately have different needs.

I am not sure what to do if both are rejected.
----------------------------------------
Feature #7336: Flexiable OPerator Precedence
https://bugs.ruby-lang.org/issues/7336#change-32862

Author: trans (Thomas Sawyer)
Status: Rejected
Priority: Normal
Assignee:
Category: core
Target version: next minor

=begin
If Ruby classes could provide some means for redefining operator precedence, it would provide the flexibility useful to some DSL use-cases.

My particular application, for instance, is in an SI units system gem that could use `^` to mean power of the unit (e.g. 1.meter^3 would mean cubic meters). But to do that right the operator needs a higher precedence. I don't expect it to be something commonly used, obviously, but it certain use cases like mine it is practically essential.

I first suggested that (({#^})) be given a higher precedence and XOR get another operator in #6678. I was not surprised that it was rejected, but I figured it was the proper first step, before proposing this much broader feature request.

As for notation, I suppose the simplest means if to create class method that can move the precedence to a position relative to another, e.g.

class Unit
precedence :^, :**

Which is to say, move (({#^})) operator to a precedence above (({#**})).
=end

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

```