[GRASS-dev] r.mapcalc operator precedence table

Hi,

While editing the operator precedence table in r.mapcalc.html, I found that
operators with higher precedence have HIGHER numbers. Shouldn't the highest
precedence have the lowest number or 1?

Huidae Cho

Huidae Cho wrote:

While editing the operator precedence table in r.mapcalc.html, I found that
operators with higher precedence have HIGHER numbers. Shouldn't the highest
precedence have the lowest number or 1?

That's the usual convention.

--
Glynn Clements <glynn@gclements.plus.com>

On Tue, Jun 06, 2006 at 05:56:08AM +0100, Glynn Clements wrote:

Huidae Cho wrote:

> While editing the operator precedence table in r.mapcalc.html, I found that
> operators with higher precedence have HIGHER numbers. Shouldn't the highest
> precedence have the lowest number or 1?

That's the usual convention.

You mean the convention is that the higher precedence has the higher number?

Huidae Cho

Huidae Cho wrote:

> > While editing the operator precedence table in r.mapcalc.html, I found that
> > operators with higher precedence have HIGHER numbers. Shouldn't the highest
> > precedence have the lowest number or 1?
>
> That's the usual convention.

You mean the convention is that the higher precedence has the higher number?

I meant that your suggestion was the usual convention, but in
retrospect it's less clear-cut. E.g. Haskell uses higher numbers for
higher precedence:

  infixr 9 .
  infixl 9 !!
  infixr 8 ^, ^^, **
  infixl 7 *, /, `quot`, `rem`, `div`, `mod`, :%, %
  infixl 6 +, -
  --infixr 5 : -- this fixity declaration is hard-wired into Hugs
  infixr 5 ++
  infix 4 ==, /=, <, <=, >=, >, `elem`, `notElem`
  infixr 3 &&
  infixr 2 ||
  infixl 1 >>, >>=
  infixr 1 =<<
  infixr 0 $, $!, `seq`

--
Glynn Clements <glynn@gclements.plus.com>