summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Matthew Dempsky <matthew@dempsky.org>2020-01-22 15:23:04 -0800
committerGravatar Matthew Dempsky <matthew@dempsky.org>2020-01-22 15:40:14 -0800
commit3256b037dafdb0818589ca475df5e2aed64f1af2 (patch)
treed80dcf615dea1f2db563f7a61eba6a57efa1696c
parent15359c4e8e4546f789dfd316109aea6aa629e96e (diff)
Elaborate e^* and e^+ syntax
Clarify that parentheses are used if and only if e consists of multiple symbols; also, that both e and the separator (if any) will be paranthesized. ("if any" is appropriate because the grammar extensions for XML include "(x[=v])*", which has no separator.) Fix the known-length type-level record syntax to indicate that commas are used to separate field descriptors. Change the pattern matching grammar to use "\mid" instead of "|" for internal consistency. (No visible change, as far as I can tell.)
-rw-r--r--doc/manual.tex6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/manual.tex b/doc/manual.tex
index 2a3f21d6..b6febfaa 100644
--- a/doc/manual.tex
+++ b/doc/manual.tex
@@ -443,7 +443,7 @@ We give the Ur language definition in \LaTeX $\;$ math mode, since that is prett
\end{tabular}
\end{center}
-We often write syntax like $e^*$ to indicate zero or more copies of $e$, $e^+$ to indicate one or more copies, and $e,^*$ and $e,^+$ to indicate multiple copies separated by commas. Another separator may be used in place of a comma. The $e$ term may be surrounded by parentheses to indicate grouping; those parentheses should not be included in the actual ASCII.
+We often write syntax like $e^*$ to indicate zero or more copies of $e$, $e^+$ to indicate one or more copies, and $e,^*$ and $e,^+$ to indicate multiple copies separated by commas. Another separator may be used in place of a comma. When $e$ consists of multiple symbols, the $e$ term and separator (if any) are surrounded by parentheses to indicate grouping; those parentheses should not be included in the actual ASCII.
We write $\ell$ for literals of the primitive types, for the most part following C conventions. There are $\mt{int}$, $\mt{float}$, $\mt{char}$, and $\mt{string}$ literals. Character literals follow the SML convention instead of the C convention, written like \texttt{\#"a"} instead of \texttt{'a'}.
@@ -492,7 +492,7 @@ $$\begin{array}{rrcll}
&&& () & \textrm{type-level unit} \\
&&& \#X & \textrm{field name} \\
\\
- &&& [(c = c)^*] & \textrm{known-length type-level record} \\
+ &&& [(c = c,)^*] & \textrm{known-length type-level record} \\
&&& c \rc c & \textrm{type-level record concatenation} \\
&&& \mt{map} & \textrm{type-level record map} \\
\\
@@ -572,7 +572,7 @@ $$\begin{array}{rrcll}
\\
&&& \mt{let} \; ed^* \; \mt{in} \; e \; \mt{end} & \textrm{local definitions} \\
\\
- &&& \mt{case} \; e \; \mt{of} \; (p \Rightarrow e|)^+ & \textrm{pattern matching} \\
+ &&& \mt{case} \; e \; \mt{of} \; (p \Rightarrow e\mid)^+ & \textrm{pattern matching} \\
\\
&&& e \; ! & \textrm{guarded expression application} \\
&&& \lambda [c \sim c] \Rightarrow e & \textrm{guarded expression abstraction} \\