|
|
1.1 ! root 1: \chapter{Directives} ! 2: Directives are included in ML as (syntactically) a subclass of declarations. ! 3: They possess scope, as do all declarations. The directives ! 4: \begin{quote} ! 5: \verb"infix" {\it d} ${\bf id}_1$ \underline{\ \ \ } ${\bf id}_n$ ! 6: ! 7: \verb"infixr" {\it d} ${\bf id}_1$ \underline{\ \ \ } ${\bf id}_n$ ! 8: \end{quote} ! 9: introduce infix status for the identifiers ${\bf id}_1$ through ${\bf id}_n$. ! 10: The digit $d$ (optional, with a default of 0) determines the ! 11: precedence, and an infixed identifier associates to the left if ! 12: introduced by \verb"infix", and to the right if introduced by ! 13: \verb"infixr". Different infixed operators of equal precedence ! 14: associate to the left. As indicated in Appendix~\ref{grammar}, the precedence ! 15: of infixed application is just weaker than that of application. ! 16: ! 17: The directive ! 18: \begin{quote} ! 19: \verb"nonfix" ${\bf id}_1$ \underline{\ \ \ } ${\bf id}_n$ ! 20: \end{quote} ! 21: cancels infix status for the named identifiers. ! 22: ! 23: While an identifier has infix status, each occurrence of it (as a ! 24: value variable or as a constructor) must be infixed or else preceded ! 25: by \verb"op". Note that this includes occurrences of the identifier ! 26: within patterns, even binding occurrences of variables. ! 27: ! 28: Several standard functions and constructors have infix status (see ! 29: Appendix~\ref{grammar}) with precedence; these are all left associative except ! 30: ``\verb"::"''.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.