On Friday 08 October 2004 11:46 pm, Markus wrote:
| >   Ruby (high to low)        User defined examples with same precedence
| >   **                        R** **R R**R  (contains ** goes right to top)
| >   ! ~ + -                   all unary operators (can we do those 'def
| > @++' ?) * / %                     *R /R %R
| >   + -                       +R -R
| >   &                         &R
| >   ^ |                       ^R |R
| >   < >                       <R R>
| >   =                         =R R=R  (equals on end illegal)
| >
| > It may have to be a bit more complex then that but you get the idea. Like
| > I said, just a thought.
|
|      That was my "doodle in meeting" project for a few days last week.
| I didn't come up with anything I liked.  For example, what do you do
| with something that comprises two or more extant operators?  How do you
| decide which part is the R and which is not-R?  How do you find the
| buddha-nature of a missmatched pair of socks?  And what if there is a
| chance congruence hidden in an operator that the users don't see?

Hmm.. well, workable rules can be made.The rules themsleves have precedence 
top tp bottom:

  1. contains ** precedence level 0 (highest)
  2. unaries level 1
  3. starts with < or ends with >, level 6
  4. contains =, level 7 (lowest)
  5. starts with * / %, level 2
  6. starts with + -, level 3
  7. starts with &, level 4
  8. starts with ^ |, level 5

OTOH, if you are saying such rules don't always pleases you, well you have two 
choices: make precedence user definable with all the baggage that looks like 
it will entail, or accept that you can't always be pleased and that following 
Ruby's general order at least makes it easy to remember.

|      I'll add you suggestions to my notes, but I'm not optimistic about
| that path.

Well, you never really know until you try. Right?

T.