<!--
  - Authors:
  -   Denys Duchier <duchier@ps.uni-sb.de>
  -   Leif Kornstaedt <kornstae@ps.uni-sb.de>
  -   Christian Schulte <schulte@ps.uni-sb.de>
  -
  - Contributors:
  -   Daniel Simon <dansim@ps.uni-sb.de> (SGML Translation)
  -
  - Copyright:
  -   Denys Duchier, Leif Kornstaedt, and Christian Schulte, 1998
  -
  - Last change:
  -   $Date: 1999/06/01 20:12:13 $ by $Author: schulte $
  -   $Revision: 1.7 $
  -
  - This file is part of Mozart, an implementation of Oz 3:
  -   http://www.mozart-oz.org
  -
  - See the file "LICENSE" or
  -   http://www.mozart-oz.org/LICENSE.html
  - for information on usage and redistribution
  - of this file, and for a DISCLAIMER OF ALL
  - WARRANTIES.
  -
  -->

<Chapter id="chapter.infix">
  <Title/Infix Notations/
  <P>
    &Oz; supports infix and prefix notation for very common procedures (see
    <Ptr.Extern to="ozdoc:notation" key="section.context-free.operators">).
  <P>
    In the following table, we give the prefix and infix notations and the
    corresponding expansions.  The operators are grouped together according
    to their precedence.  Members of the same group have the same precedence,
    groups further up have lower precedence than groups further down.
    <Q/Having higher precedence/ means <Q/binding tighter/; &eg;, the term
    <<X.Y + Z>> is equal to <<(X.Y) + Z>>.  Ambiguities within each group
    are resolved by the associativity given before each group (&eg;,
    <<X - Y + Z>> is equivalent to <<(X - Y) + Z>>).
    <Table>
      <TR/<TH/Infix/<TH/Normal//
      <TR/<TD colspan=2/right-associative//
      <TR/<TD/<<?_{X} = ?_{Y}>>/<TD/<<{Value.'=' ?_{X} ?_{Y}}>>//
      <TR/<TD colspan=2/right-associative//
      <TR/<TD/<<?+{LI} <- ?_{X}>>/<TD/<<{Object.'<-' ?_{LI} ?_{X}}>>//
      <TR/<TD/<<?_{Y} = ?+{LI} <- ?_{X}>>/
	<TD/<<{Object.exchange ?_{LI} ?_{X} ?_{Y}}>>//
      <TR/<TD colspan=2/non-associative//
      <TR/<TD/<<??{B} = ?_{X} == ?_{Y}>>/
	<TD/<<{Value.'==' ?_{X} ?_{Y} ?_{B}}>>//
      <TR/<TD/<<??{B} = ?_{X} \= ?_{Y}>>/
	<TD/<<{Value.'\\=' ?_{X} ?_{Y} ?_{B}}>>//
      <TR/<TD/<<??{B} = ?+{AFI1} &lt; ?+{AFI2}>>/
	<TD/<<{Value.'&lt' ?_{AFI1} ?_{AFI2} ?_{B}}>>//
      <TR/<TD/<<??{B} = ?+{AFI1} =&lt; ?+{AFI2}>>/
	<TD/<<{Value.'=&lt;' ?_{AFI1} ?_{AFI2} ?_{B}}>>//
      <TR/<TD/<<??{B} = ?+{AFI1} > ?+{AFI2}>>/
	<TD/<<{Value.'>' ?_{AFI1} ?_{AFI2} ?_{B}}>>//
      <TR/<TD/<<??{B} = ?+{AFI1} >= ?+{AFI2}>>/
	<TD/<<{Value.'>=' ?_{AFI1} ?_{AFI2} ?_{B}}>>//
      <TR/<TD colspan=2/left-associative//
      <TR/<TD/<<??{FI3} = ?+{FI1} + ?+{FI2}>>/
	<TD/<<{Number.'+' ?_{FI1} ?_{FI2} ?_{FI3}}>>//
      <TR/<TD/<<??{FI3} = ?+{FI1} - ?+{FI2}>>/
	<TD/<<{Number.'-' ?_{FI1} ?_{FI2} ?_{FI3}}>>//
      <TR/<TD colspan=2/left-associative//
      <TR/<TD/<<??{FI3} = ?+{FI1} * ?+{FI2}>>/
	<TD/<<{Number.'*' ?_{FI1} ?_{FI2} ?_{FI3}}>>//
      <TR><TD><<??{F3} = ?+{F1} / ?+{F2}>></TD>
	<TD><<{Float.'/' ?_{F1} ?_{F2} ?_{F3}}>></TD></TR>
      <TR/<TD/<<??{I3} = ?+{I1} div ?+{I2}>>/
	<TD/<<{Int.'div' ?_{I1} ?_{I2} ?_{I3}}>>//
      <TR/<TD/<<??{I3} = ?+{I1} mod ?+{I2}>>/
	<TD/<<{Int.'mod' ?_{I1} ?_{I2} ?_{I3}}>>//
      <TR/<TD colspan=2/left-associative//
      <TR/<TD/<<?+{K}, ?+{R}>>/<TD/<<{Object.',' ?_{K} ?_{R}}>>//
      <TR/<TD colspan=2/prefix//
      <TR/<TD/<<??{FI1} = ~?+{FI2}>>/<TD/<<{Number.'~' ?_{FI2} ?_{FI1}}>>//
      <TR/<TD colspan=2/left-associative//
      <TR/<TD/<<?_{X} = ?+{RC}.?+{LI}>>/
	<TD/<<{Value.'.' ?_{RC} ?_{LI} ?_{X}}>>//
      <TR/<TD colspan=2/infix//
      <TR/<TD/<<?_{X} = @?+{LI}>>/<TD/<<{Object.'@' ?_{LI} ?_{X}}>>//
      <TR/<TD/<<?_{X} = !!?_{Y}>>/<TD/<<{Value.'!!' ?_{X} ?_{Y}}>>//
    </Table>
</Chapter>
