Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cml/doc/Hardcopy/cml.tex
ViewVC logotype

Diff of /sml/trunk/src/cml/doc/Hardcopy/cml.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 843, Tue Jun 19 21:53:04 2001 UTC revision 844, Wed Jun 20 20:39:15 2001 UTC
# Line 1  Line 1 
1  \section{The {\tt CML} structure}  \maybeclearpage
2    \section{The {\cf CML} structure}
3    
4    
5    
6  \begin{synopsis}  \begin{synopsis}
7  \item {\textbf{signature}} CML\label{sig-CML}  \item {\kw{signature}} \textcf{CML}\label{sig-CML}
8  \item {\STRUCTURE} CML: CML\label{str-CML}  \item {\STRUCTURE} \textcf{CML: CML}\label{str-CML}
9  \end{synopsis}  \end{synopsis}
10    
11  \begin{interface}  \begin{interface}
12  \item {\index{thread_id@thread\_\linebreak[0]id!CML@CML}}{\textbf{type}} thread\_\linebreak[0]id  \Nopagebreak
13  \item {\index{chan@chan!CML@CML}}{\textbf{type}} \(\alpha\)~chan  \item {\index{thread_id@thread\_\linebreak[0]id!CML@\textcf{CML}}}{\kw{type}} \textcf{thread\_\linebreak[0]id}
14  \item {\index{event@event!CML@CML}}{\textbf{type}} \(\alpha\)~event  \Nopagebreak
15  \item {\index{version@version!CML@CML}}{\textbf{val}} {\tt version: \(\{\mathrm{system}:\mathrm{string},\,\mathrm{version\_id}:\mathrm{int}\;\mathrm{list},\,\mathrm{date}:\mathrm{string}\}\)}  \item {\index{chan@chan!CML@\textcf{CML}}}{\kw{type}} \(\alpha\)~\textcf{chan}
16    \Nopagebreak
17    \item {\index{event@event!CML@\textcf{CML}}}{\kw{type}} \(\alpha\)~\textcf{event}
18    \Nopagebreak
19    \item {\index{version@version!CML@\textcf{CML}}}{\kw{val}} {\cf version: \(\{\mbox{\cf{}system}:\mbox{\cf{}string},\,\mbox{\cf{}version\_id}:\mbox{\cf{}int}\;\mbox{\cf{}list},\,\mbox{\cf{}date}:\mbox{\cf{}string}\}\)}
20    
21  \item {\index{banner@banner!CML@CML}}{\textbf{val}} {\tt banner: \(\mathrm{string}\)}  \item {\index{banner@banner!CML@\textcf{CML}}}{\kw{val}} {\cf banner: \(\mbox{\cf{}string}\)}
22    
23  \item {\index{spawnc@spawnc!CML@CML}}{\textbf{val}} {\tt spawnc: \((\alpha\rightarrow \mathrm{unit})\rightarrow \alpha\rightarrow \mathrm{thread\_id}\)}  \Nopagebreak
24    \item {\index{spawnc@spawnc!CML@\textcf{CML}}}{\kw{val}} {\cf spawnc: \((\alpha\rightarrow \mbox{\cf{}unit})\rightarrow \alpha\rightarrow \mbox{\cf{}thread\_id}\)}
25    
26  \item {\index{spawn@spawn!CML@CML}}{\textbf{val}} {\tt spawn: \((\mathrm{unit}\rightarrow \mathrm{unit})\rightarrow \mathrm{thread\_id}\)}  \item {\index{spawn@spawn!CML@\textcf{CML}}}{\kw{val}} {\cf spawn: \((\mbox{\cf{}unit}\rightarrow \mbox{\cf{}unit})\rightarrow \mbox{\cf{}thread\_id}\)}
27    
28  \item {\index{yield@yield!CML@CML}}{\textbf{val}} {\tt yield: \(\mathrm{unit}\rightarrow \mathrm{unit}\)}  \Nopagebreak
29    \item {\index{yield@yield!CML@\textcf{CML}}}{\kw{val}} {\cf yield: \(\mbox{\cf{}unit}\rightarrow \mbox{\cf{}unit}\)}
30    
31  \item {\index{exit@exit!CML@CML}}{\textbf{val}} {\tt exit: \(\mathrm{unit}\rightarrow \alpha\)}  \Nopagebreak
32    \item {\index{exit@exit!CML@\textcf{CML}}}{\kw{val}} {\cf exit: \(\mbox{\cf{}unit}\rightarrow \alpha\)}
33    
34  \item {\index{getTid@getTid!CML@CML}}{\textbf{val}} {\tt getTid: \(\mathrm{unit}\rightarrow \mathrm{thread\_id}\)}  \Nopagebreak
35    \item {\index{getTid@getTid!CML@\textcf{CML}}}{\kw{val}} {\cf getTid: \(\mbox{\cf{}unit}\rightarrow \mbox{\cf{}thread\_id}\)}
36    
37  \item {\index{sameTid@sameTid!CML@CML}}{\textbf{val}} {\tt sameTid: \((\mathrm{thread\_id}\:\verb,*,\:\mathrm{thread\_id})\rightarrow \mathrm{bool}\)}  \Nopagebreak
38    \item {\index{sameTid@sameTid!CML@\textcf{CML}}}{\kw{val}} {\cf sameTid: \((\mbox{\cf{}thread\_id}\mtoksep{}\verb,*,\mtoksep{}\mbox{\cf{}thread\_id})\rightarrow \mbox{\cf{}bool}\)}
39    
40  \item {\index{compareTid@compareTid!CML@CML}}{\textbf{val}} {\tt compareTid: \((\mathrm{thread\_id}\:\verb,*,\:\mathrm{thread\_id})\rightarrow \mathrm{order}\)}  \Nopagebreak
41    \item {\index{compareTid@compareTid!CML@\textcf{CML}}}{\kw{val}} {\cf compareTid: \((\mbox{\cf{}thread\_id}\mtoksep{}\verb,*,\mtoksep{}\mbox{\cf{}thread\_id})\rightarrow \mbox{\cf{}order}\)}
42    
43  \item {\index{hashTid@hashTid!CML@CML}}{\textbf{val}} {\tt hashTid: \(\mathrm{thread\_id}\rightarrow \mathrm{word}\)}  \Nopagebreak
44    \item {\index{hashTid@hashTid!CML@\textcf{CML}}}{\kw{val}} {\cf hashTid: \(\mbox{\cf{}thread\_id}\rightarrow \mbox{\cf{}word}\)}
45    
46  \item {\index{tidToString@tidToString!CML@CML}}{\textbf{val}} {\tt tidToString: \(\mathrm{thread\_id}\rightarrow \mathrm{string}\)}  \Nopagebreak
47    \item {\index{tidToString@tidToString!CML@\textcf{CML}}}{\kw{val}} {\cf tidToString: \(\mbox{\cf{}thread\_id}\rightarrow \mbox{\cf{}string}\)}
48    
49  \item {\index{joinEvt@joinEvt!CML@CML}}{\textbf{val}} {\tt joinEvt: \(\mathrm{thread\_id}\rightarrow \mathrm{unit}\;\mathrm{event}\)}  \Nopagebreak
50    \item {\index{joinEvt@joinEvt!CML@\textcf{CML}}}{\kw{val}} {\cf joinEvt: \(\mbox{\cf{}thread\_id}\rightarrow \mbox{\cf{}unit}\;\mbox{\cf{}event}\)}
51    
52  \item {\index{channel@channel!CML@CML}}{\textbf{val}} {\tt channel: \(\mathrm{unit}\rightarrow \alpha\:\mathrm{chan}\)}  \Nopagebreak
53    \item {\index{channel@channel!CML@\textcf{CML}}}{\kw{val}} {\cf channel: \(\mbox{\cf{}unit}\rightarrow \alpha\mtoksep{}\mbox{\cf{}chan}\)}
54    
55  \item {\index{sameChannel@sameChannel!CML@CML}}{\textbf{val}} {\tt sameChannel: \((\alpha\:\mathrm{chan}\:\verb,*,\:\alpha\:\mathrm{chan})\rightarrow \mathrm{bool}\)}  \Nopagebreak
56    \item {\index{sameChannel@sameChannel!CML@\textcf{CML}}}{\kw{val}} {\cf sameChannel: \((\alpha\mtoksep{}\mbox{\cf{}chan}\mtoksep{}\verb,*,\mtoksep{}\alpha\mtoksep{}\mbox{\cf{}chan})\rightarrow \mbox{\cf{}bool}\)}
57    
58  \item {\index{send@send!CML@CML}}{\textbf{val}} {\tt send: \((\alpha\:\mathrm{chan}\:\verb,*,\:\alpha)\rightarrow \mathrm{unit}\)}  \Nopagebreak
59    \item {\index{send@send!CML@\textcf{CML}}}{\kw{val}} {\cf send: \((\alpha\mtoksep{}\mbox{\cf{}chan}\mtoksep{}\verb,*,\mtoksep{}\alpha)\rightarrow \mbox{\cf{}unit}\)}
60    
61  \item {\index{recv@recv!CML@CML}}{\textbf{val}} {\tt recv: \(\alpha\:\mathrm{chan}\rightarrow \alpha\)}  \Nopagebreak
62    \item {\index{recv@recv!CML@\textcf{CML}}}{\kw{val}} {\cf recv: \(\alpha\mtoksep{}\mbox{\cf{}chan}\rightarrow \alpha\)}
63    
64  \item {\index{sendEvt@sendEvt!CML@CML}}{\textbf{val}} {\tt sendEvt: \((\alpha\:\mathrm{chan}\:\verb,*,\:\alpha)\rightarrow \mathrm{unit}\;\mathrm{event}\)}  \Nopagebreak
65    \item {\index{sendEvt@sendEvt!CML@\textcf{CML}}}{\kw{val}} {\cf sendEvt: \((\alpha\mtoksep{}\mbox{\cf{}chan}\mtoksep{}\verb,*,\mtoksep{}\alpha)\rightarrow \mbox{\cf{}unit}\;\mbox{\cf{}event}\)}
66    
67  \item {\index{recvEvt@recvEvt!CML@CML}}{\textbf{val}} {\tt recvEvt: \(\alpha\:\mathrm{chan}\rightarrow \alpha\:\mathrm{event}\)}  \item {\index{recvEvt@recvEvt!CML@\textcf{CML}}}{\kw{val}} {\cf recvEvt: \(\alpha\mtoksep{}\mbox{\cf{}chan}\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}
68    
69  \item {\index{sendPoll@sendPoll!CML@CML}}{\textbf{val}} {\tt sendPoll: \((\alpha\:\mathrm{chan}\:\verb,*,\:\alpha)\rightarrow \mathrm{bool}\)}  \Nopagebreak
70    \item {\index{sendPoll@sendPoll!CML@\textcf{CML}}}{\kw{val}} {\cf sendPoll: \((\alpha\mtoksep{}\mbox{\cf{}chan}\mtoksep{}\verb,*,\mtoksep{}\alpha)\rightarrow \mbox{\cf{}bool}\)}
71    
72  \item {\index{recvPoll@recvPoll!CML@CML}}{\textbf{val}} {\tt recvPoll: \(\alpha\:\mathrm{chan}\rightarrow \alpha\:\mathrm{option}\)}  \Nopagebreak
73    \item {\index{recvPoll@recvPoll!CML@\textcf{CML}}}{\kw{val}} {\cf recvPoll: \(\alpha\mtoksep{}\mbox{\cf{}chan}\rightarrow \alpha\mtoksep{}\mbox{\cf{}option}\)}
74    
75  \item {\index{wrap@wrap!CML@CML}}{\textbf{val}} {\tt wrap: \((\alpha\:\mathrm{event}\:\verb,*,(\alpha\rightarrow \beta))\rightarrow \beta\:\mathrm{event}\)}  \Nopagebreak
76    \item {\index{wrap@wrap!CML@\textcf{CML}}}{\kw{val}} {\cf wrap: \((\alpha\mtoksep{}\mbox{\cf{}event}\mtoksep{}\verb,*,(\alpha\rightarrow \beta))\rightarrow \beta\mtoksep{}\mbox{\cf{}event}\)}
77    
78  \item {\index{wrapHandler@wrapHandler!CML@CML}}{\textbf{val}} {\tt wrapHandler: \((\alpha\:\mathrm{event}\:\verb,*,(\mathrm{exn}\rightarrow \alpha\:\mathrm{event}))\rightarrow \alpha\:\mathrm{event}\)}  \Nopagebreak
79    \item {\index{wrapHandler@wrapHandler!CML@\textcf{CML}}}{\kw{val}} {\cf wrapHandler: \((\alpha\mtoksep{}\mbox{\cf{}event}\mtoksep{}\verb,*,(\mbox{\cf{}exn}\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}))\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}
80    
81  \item {\index{guard@guard!CML@CML}}{\textbf{val}} {\tt guard: \((\mathrm{unit}\rightarrow \alpha\:\mathrm{event})\rightarrow \alpha\:\mathrm{event}\)}  \Nopagebreak
82    \item {\index{guard@guard!CML@\textcf{CML}}}{\kw{val}} {\cf guard: \((\mbox{\cf{}unit}\rightarrow \alpha\mtoksep{}\mbox{\cf{}event})\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}
83    
84  \item {\index{withNack@withNack!CML@CML}}{\textbf{val}} {\tt withNack: \((\mathrm{unit}\;\mathrm{event}\rightarrow \alpha\:\mathrm{event})\rightarrow \alpha\:\mathrm{event}\)}  \Nopagebreak
85    \item {\index{withNack@withNack!CML@\textcf{CML}}}{\kw{val}} {\cf withNack: \((\mbox{\cf{}unit}\;\mbox{\cf{}event}\rightarrow \alpha\mtoksep{}\mbox{\cf{}event})\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}
86    
87  \item {\index{choose@choose!CML@CML}}{\textbf{val}} {\tt choose: \(\alpha\:\mathrm{event}\;\mathrm{list}\rightarrow \alpha\:\mathrm{event}\)}  \Nopagebreak
88    \item {\index{choose@choose!CML@\textcf{CML}}}{\kw{val}} {\cf choose: \(\alpha\mtoksep{}\mbox{\cf{}event}\;\mbox{\cf{}list}\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}
89    
90  \item {\index{sync@sync!CML@CML}}{\textbf{val}} {\tt sync: \(\alpha\:\mathrm{event}\rightarrow \alpha\)}  \Nopagebreak
91    \item {\index{sync@sync!CML@\textcf{CML}}}{\kw{val}} {\cf sync: \(\alpha\mtoksep{}\mbox{\cf{}event}\rightarrow \alpha\)}
92    
93  \item {\index{select@select!CML@CML}}{\textbf{val}} {\tt select: \(\alpha\:\mathrm{event}\;\mathrm{list}\rightarrow \alpha\)}  \Nopagebreak
94    \item {\index{select@select!CML@\textcf{CML}}}{\kw{val}} {\cf select: \(\alpha\mtoksep{}\mbox{\cf{}event}\;\mbox{\cf{}list}\rightarrow \alpha\)}
95    
96  \item {\index{never@never!CML@CML}}{\textbf{val}} {\tt never: \(\alpha\:\mathrm{event}\)}  \Nopagebreak
97    \item {\index{never@never!CML@\textcf{CML}}}{\kw{val}} {\cf never: \(\alpha\mtoksep{}\mbox{\cf{}event}\)}
98    
99  \item {\index{alwaysEvt@alwaysEvt!CML@CML}}{\textbf{val}} {\tt alwaysEvt: \(\alpha\rightarrow \alpha\:\mathrm{event}\)}  \Nopagebreak
100    \item {\index{alwaysEvt@alwaysEvt!CML@\textcf{CML}}}{\kw{val}} {\cf alwaysEvt: \(\alpha\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}
101    
102  \item {\index{timeOutEvt@timeOutEvt!CML@CML}}{\textbf{val}} {\tt timeOutEvt: \(\mathrm{Time}.\mathrm{time}\rightarrow \mathrm{unit}\;\mathrm{event}\)}  \Nopagebreak
103    \item {\index{timeOutEvt@timeOutEvt!CML@\textcf{CML}}}{\kw{val}} {\cf timeOutEvt: \(\mbox{\cf{}Time}.\mbox{\cf{}time}\rightarrow \mbox{\cf{}unit}\;\mbox{\cf{}event}\)}
104    
105  \item {\index{atTimeEvt@atTimeEvt!CML@CML}}{\textbf{val}} {\tt atTimeEvt: \(\mathrm{Time}.\mathrm{time}\rightarrow \mathrm{unit}\;\mathrm{event}\)}  \Nopagebreak
106    \item {\index{atTimeEvt@atTimeEvt!CML@\textcf{CML}}}{\kw{val}} {\cf atTimeEvt: \(\mbox{\cf{}Time}.\mbox{\cf{}time}\rightarrow \mbox{\cf{}unit}\;\mbox{\cf{}event}\)}
107    
108  \end{interface}  \end{interface}
109    
110  \begin{descr}  \begin{descr}
111  \item {\index{thread_id@thread\_\linebreak[0]id!CML@CML}}{\textbf{type}} thread\_\linebreak[0]id\label{ty-CML.thread_id}  \item {\index{thread_id@thread\_\linebreak[0]id!CML@\textcf{CML}}}{\kw{type}} \textcf{thread\_\linebreak[0]id}\label{ty-CML.thread_id}
112    
113  \begin{speccomment}  \begin{speccomment}
114  \item  \item
115    
116            Thread IDs are the unique IDs associated with CML threads.\-    These IDs are in an unspecified total order that can be used to         break cyclic depedencies (see \texttt{compare\-Tid}).\-     \end{speccomment}            Thread IDs are the unique IDs associated with CML threads.      These IDs are in an unspecified total order that can be used to         break cyclic depedencies (see {\cf \small compare\-Tid}).     \end{speccomment}
117  \item {\index{chan@chan!CML@CML}}{\textbf{type}} \(\alpha\)~chan\label{ty-CML.chan}  \item {\index{chan@chan!CML@\textcf{CML}}}{\kw{type}} \(\alpha\)~\textcf{chan}\label{ty-CML.chan}
118    
119  \begin{speccomment}  \begin{speccomment}
120  \item  \item
121    
122            This is the type constructor for synchronous channels.\-     \end{speccomment}            This is the type constructor for synchronous channels.     \end{speccomment}
123  \item {\index{event@event!CML@CML}}{\textbf{type}} \(\alpha\)~event\label{ty-CML.event}  \item {\index{event@event!CML@\textcf{CML}}}{\kw{type}} \(\alpha\)~\textcf{event}\label{ty-CML.event}
124    
125  \begin{speccomment}  \begin{speccomment}
126  \item  \item
127    
128            Event values are abstract representations of synchronous operations     (so called \emph{first-class sychronous operations}).\-     \end{speccomment}            Event values are abstract representations of synchronous operations     (so called \emph{first-class sychronous operations}).     \end{speccomment}
129  \item {\index{banner@banner!CML@CML}}{\textbf{val}} {\tt banner: \(\mathrm{string}\)}\label{val-CML.banner}  \item {\index{version@version!CML@\textcf{CML}}}{\kw{val}} {\cf version: \(\{\mbox{\cf{}system}:\mbox{\cf{}string},\,\mbox{\cf{}version\_id}:\mbox{\cf{}int}\;\mbox{\cf{}list},\,\mbox{\cf{}date}:\mbox{\cf{}string}\}\)}\label{val-CML.version}
130    
131    \item {\index{banner@banner!CML@\textcf{CML}}}{\kw{val}} {\cf banner: \(\mbox{\cf{}string}\)}\label{val-CML.banner}
132    
133    
134  \begin{speccomment}  \begin{speccomment}
135  \item  \item
136    
137          These specify the version of CML in the same format as SML/NJ.\-     \end{speccomment}          These specify the version of CML in the same format as SML/NJ.     \end{speccomment}
138  \item {\index{spawn@spawn!CML@CML}}{\textbf{val}} {\tt spawn: \((\mathrm{unit}\rightarrow \mathrm{unit})\rightarrow \mathrm{thread\_id}\)}\label{val-CML.spawn}  \item {\index{spawnc@spawnc!CML@\textcf{CML}}}{\kw{val}} {\cf spawnc: \((\alpha\rightarrow \mbox{\cf{}unit})\rightarrow \alpha\rightarrow \mbox{\cf{}thread\_id}\)}\label{val-CML.spawnc}
139    
140    \item {\index{spawn@spawn!CML@\textcf{CML}}}{\kw{val}} {\cf spawn: \((\mbox{\cf{}unit}\rightarrow \mbox{\cf{}unit})\rightarrow \mbox{\cf{}thread\_id}\)}\label{val-CML.spawn}
141    
142    
143  \begin{speccomment}  \begin{speccomment}
144  \item {\tt spawnc \textit{f} \textit{x}         }\linebreak  \item {\cf \small spawnc \mbox{\cf \small \textit{f}} \mbox{\cf \small \textit{x}}      \newline}
145  {\tt           spawn \textit{f}         }  {\cf \small           spawn \mbox{\cf \small \textit{f}}         }
146  creates a new thread of control to evaluate the body of \textit{f}.\-   A new unique ID for the thread is created and returned.\-     \end{speccomment}  creates a new thread of control to evaluate the body of \mbox{\cf \small \textit{f}}.   A new unique ID for the thread is created and returned.     \end{speccomment}
147  \item {\index{yield@yield!CML@CML}}{\textbf{val}} {\tt yield: \(\mathrm{unit}\rightarrow \mathrm{unit}\)}\label{val-CML.yield}  \item {\index{yield@yield!CML@\textcf{CML}}}{\kw{val}} {\cf yield: \(\mbox{\cf{}unit}\rightarrow \mbox{\cf{}unit}\)}\label{val-CML.yield}
148    
149    
150  \begin{speccomment}  \begin{speccomment}
151  \item  \item
152    
153          This function can be used to implement an explicit context switch.\-    Since CML is preemptively scheduled, it should never be necessary for   user programs to call this function.\-  It is mainly used for performance measurements.\-     \end{speccomment}          This function can be used to implement an explicit context switch.      Since CML is preemptively scheduled, it should never be necessary for   user programs to call this function.    It is mainly used for performance measurements.     \end{speccomment}
154  \item {\index{exit@exit!CML@CML}}{\textbf{val}} {\tt exit: \(\mathrm{unit}\rightarrow \alpha\)}\label{val-CML.exit}  \item {\index{exit@exit!CML@\textcf{CML}}}{\kw{val}} {\cf exit: \(\mbox{\cf{}unit}\rightarrow \alpha\)}\label{val-CML.exit}
155    
156    
157  \begin{speccomment}  \begin{speccomment}
158  \item {\tt exit ()      }  \item {\cf \small exit ()       }
159  causes the calling thread to terminate.\-     \end{speccomment}  causes the calling thread to terminate.     \end{speccomment}
160  \item {\index{getTid@getTid!CML@CML}}{\textbf{val}} {\tt getTid: \(\mathrm{unit}\rightarrow \mathrm{thread\_id}\)}\label{val-CML.getTid}  \item {\index{getTid@getTid!CML@\textcf{CML}}}{\kw{val}} {\cf getTid: \(\mbox{\cf{}unit}\rightarrow \mbox{\cf{}thread\_id}\)}\label{val-CML.getTid}
161    
162    
163  \begin{speccomment}  \begin{speccomment}
164  \item {\tt get\-Tid ()           }  \item {\cf \small get\-Tid ()           }
165  returns the thread ID of the calling thread.\-     \end{speccomment}  returns the thread ID of the calling thread.     \end{speccomment}
166  \item {\index{sameTid@sameTid!CML@CML}}{\textbf{val}} {\tt sameTid: \((\mathrm{thread\_id}\:\verb,*,\:\mathrm{thread\_id})\rightarrow \mathrm{bool}\)}\label{val-CML.sameTid}  \item {\index{sameTid@sameTid!CML@\textcf{CML}}}{\kw{val}} {\cf sameTid: \((\mbox{\cf{}thread\_id}\mtoksep{}\verb,*,\mtoksep{}\mbox{\cf{}thread\_id})\rightarrow \mbox{\cf{}bool}\)}\label{val-CML.sameTid}
167    
168    
169  \begin{speccomment}  \begin{speccomment}
170  \item {\tt same\-Tid (\textit{tid1}, \textit{tid2})           }  \item {\cf \small same\-Tid (\mbox{\cf \small \textit{tid1}}, \mbox{\cf \small \textit{tid2}})           }
171  returns true, if the two thread IDs are the same ID.\-     \end{speccomment}  returns true, if the two thread IDs are the same ID.     \end{speccomment}
172  \item {\index{compareTid@compareTid!CML@CML}}{\textbf{val}} {\tt compareTid: \((\mathrm{thread\_id}\:\verb,*,\:\mathrm{thread\_id})\rightarrow \mathrm{order}\)}\label{val-CML.compareTid}  \item {\index{compareTid@compareTid!CML@\textcf{CML}}}{\kw{val}} {\cf compareTid: \((\mbox{\cf{}thread\_id}\mtoksep{}\verb,*,\mtoksep{}\mbox{\cf{}thread\_id})\rightarrow \mbox{\cf{}order}\)}\label{val-CML.compareTid}
173    
174    
175  \begin{speccomment}  \begin{speccomment}
176  \item {\tt compare\-Tid (\textit{tid1}, \textit{tid2})           }  \item {\cf \small compare\-Tid (\mbox{\cf \small \textit{tid1}}, \mbox{\cf \small \textit{tid2}})           }
177  compares the two thread IDs and returns their order in the total          ordering of thread IDs.\-       The precise semantics of this ordering is left unspecified, other       than to say it is a total order.\-     \end{speccomment}  compares the two thread IDs and returns their order in the total          ordering of thread IDs.         The precise semantics of this ordering is left unspecified, other       than to say it is a total order.     \end{speccomment}
178  \item {\index{hashTid@hashTid!CML@CML}}{\textbf{val}} {\tt hashTid: \(\mathrm{thread\_id}\rightarrow \mathrm{word}\)}\label{val-CML.hashTid}  \item {\index{hashTid@hashTid!CML@\textcf{CML}}}{\kw{val}} {\cf hashTid: \(\mbox{\cf{}thread\_id}\rightarrow \mbox{\cf{}word}\)}\label{val-CML.hashTid}
179    
180    
181  \begin{speccomment}  \begin{speccomment}
182  \item {\tt hash\-Tid \textit{tid}           }  \item {\cf \small hash\-Tid \mbox{\cf \small \textit{tid}}           }
183  returns a hashing of the thread ID \textit{tid}.\-     \end{speccomment}  returns a hashing of the thread ID \mbox{\cf \small \textit{tid}}.     \end{speccomment}
184  \item {\index{tidToString@tidToString!CML@CML}}{\textbf{val}} {\tt tidToString: \(\mathrm{thread\_id}\rightarrow \mathrm{string}\)}\label{val-CML.tidToString}  \item {\index{tidToString@tidToString!CML@\textcf{CML}}}{\kw{val}} {\cf tidToString: \(\mbox{\cf{}thread\_id}\rightarrow \mbox{\cf{}string}\)}\label{val-CML.tidToString}
185    
186    
187  \begin{speccomment}  \begin{speccomment}
188  \item {\tt tid\-To\-String \textit{tid}           }  \item {\cf \small tid\-To\-String \mbox{\cf \small \textit{tid}}           }
189  returns a string representation of the thread ID \textit{tid}.\-     \end{speccomment}  returns a string representation of the thread ID \mbox{\cf \small \textit{tid}}.     \end{speccomment}
190  \item {\index{joinEvt@joinEvt!CML@CML}}{\textbf{val}} {\tt joinEvt: \(\mathrm{thread\_id}\rightarrow \mathrm{unit}\;\mathrm{event}\)}\label{val-CML.joinEvt}  \item {\index{joinEvt@joinEvt!CML@\textcf{CML}}}{\kw{val}} {\cf joinEvt: \(\mbox{\cf{}thread\_id}\rightarrow \mbox{\cf{}unit}\;\mbox{\cf{}event}\)}\label{val-CML.joinEvt}
191    
192    
193  \begin{speccomment}  \begin{speccomment}
194  \item {\tt join\-Evt \textit{tid}           }  \item {\cf \small join\-Evt \mbox{\cf \small \textit{tid}}           }
195  creates an event value for synchronizing on the termination of    the thread with the ID \textit{tid}.\-          There are three ways that a thread may terminate: the function that     was passed to \texttt{spawn} may return; it may call the \texttt{exit}          function, or it may have an uncaught exception.\-       Note that \texttt{join\-Evt} does not distinguish between these         cases; it also does not become enabled if the named thread deadlocks    (even if it is garbage collected).\-     \end{speccomment}  creates an event value for synchronizing on the termination of    the thread with the ID \mbox{\cf \small \textit{tid}}.          There are three ways that a thread may terminate: the function that     was passed to {\cf \small spawn} may return; it may call the {\cf \small exit}          function, or it may have an uncaught exception.         Note that {\cf \small join\-Evt} does not distinguish between these     cases; it also does not become enabled if the named thread deadlocks    (even if it is garbage collected).     \end{speccomment}
196  \item {\index{channel@channel!CML@CML}}{\textbf{val}} {\tt channel: \(\mathrm{unit}\rightarrow \alpha\:\mathrm{chan}\)}\label{val-CML.channel}  \item {\index{channel@channel!CML@\textcf{CML}}}{\kw{val}} {\cf channel: \(\mbox{\cf{}unit}\rightarrow \alpha\mtoksep{}\mbox{\cf{}chan}\)}\label{val-CML.channel}
197    
198    
199  \begin{speccomment}  \begin{speccomment}
200  \item {\tt channel ()           }  \item {\cf \small channel ()           }
201  creates a new synchronous channel.\-     \end{speccomment}  creates a new synchronous channel.     \end{speccomment}
202  \item {\index{sameChannel@sameChannel!CML@CML}}{\textbf{val}} {\tt sameChannel: \((\alpha\:\mathrm{chan}\:\verb,*,\:\alpha\:\mathrm{chan})\rightarrow \mathrm{bool}\)}\label{val-CML.sameChannel}  \item {\index{sameChannel@sameChannel!CML@\textcf{CML}}}{\kw{val}} {\cf sameChannel: \((\alpha\mtoksep{}\mbox{\cf{}chan}\mtoksep{}\verb,*,\mtoksep{}\alpha\mtoksep{}\mbox{\cf{}chan})\rightarrow \mbox{\cf{}bool}\)}\label{val-CML.sameChannel}
203    
204    
205  \begin{speccomment}  \begin{speccomment}
206  \item {\tt same\-Channel (\textit{ch1}, \textit{ch2})           }  \item {\cf \small same\-Channel (\mbox{\cf \small \textit{ch1}}, \mbox{\cf \small \textit{ch2}})           }
207  returns true, if the two channels are the same channel.\-     \end{speccomment}  returns true, if the two channels are the same channel.     \end{speccomment}
208  \item {\index{send@send!CML@CML}}{\textbf{val}} {\tt send: \((\alpha\:\mathrm{chan}\:\verb,*,\:\alpha)\rightarrow \mathrm{unit}\)}\label{val-CML.send}  \item {\index{send@send!CML@\textcf{CML}}}{\kw{val}} {\cf send: \((\alpha\mtoksep{}\mbox{\cf{}chan}\mtoksep{}\verb,*,\mtoksep{}\alpha)\rightarrow \mbox{\cf{}unit}\)}\label{val-CML.send}
209    
210    
211  \begin{speccomment}  \begin{speccomment}
212  \item {\tt send (\textit{ch}, \textit{a})           }  \item {\cf \small send (\mbox{\cf \small \textit{ch}}, \mbox{\cf \small \textit{a}})           }
213  sends the message \textit{a} on the synchronous channel \textit{ch}.\-    This operation blocks the calling thread until there is another         thread attempting a \texttt{recv} operation on the channel \textit{ch}.\-     \end{speccomment}  sends the message \mbox{\cf \small \textit{a}} on the synchronous channel \mbox{\cf \small \textit{ch}}.          This operation blocks the calling thread until there is another         thread attempting a {\cf \small recv} operation on the channel \mbox{\cf \small \textit{ch}}.     \end{speccomment}
214  \item {\index{recv@recv!CML@CML}}{\textbf{val}} {\tt recv: \(\alpha\:\mathrm{chan}\rightarrow \alpha\)}\label{val-CML.recv}  \item {\index{recv@recv!CML@\textcf{CML}}}{\kw{val}} {\cf recv: \(\alpha\mtoksep{}\mbox{\cf{}chan}\rightarrow \alpha\)}\label{val-CML.recv}
215    
216    
217  \begin{speccomment}  \begin{speccomment}
218  \item {\tt recv \textit{ch}           }  \item {\cf \small recv \mbox{\cf \small \textit{ch}}           }
219  receives a message from the channel \textit{ch}.\-        This operation blocks the calling thread until there is another         thread attempting a \texttt{send} operation on the channel \textit{ch}.\-     \end{speccomment}  receives a message from the channel \mbox{\cf \small \textit{ch}}.        This operation blocks the calling thread until there is another         thread attempting a {\cf \small send} operation on the channel \mbox{\cf \small \textit{ch}}.     \end{speccomment}
220  \item {\index{recvEvt@recvEvt!CML@CML}}{\textbf{val}} {\tt recvEvt: \(\alpha\:\mathrm{chan}\rightarrow \alpha\:\mathrm{event}\)}\label{val-CML.recvEvt}  \item {\index{sendEvt@sendEvt!CML@\textcf{CML}}}{\kw{val}} {\cf sendEvt: \((\alpha\mtoksep{}\mbox{\cf{}chan}\mtoksep{}\verb,*,\mtoksep{}\alpha)\rightarrow \mbox{\cf{}unit}\;\mbox{\cf{}event}\)}\label{val-CML.sendEvt}
221    
222    \item {\index{recvEvt@recvEvt!CML@\textcf{CML}}}{\kw{val}} {\cf recvEvt: \(\alpha\mtoksep{}\mbox{\cf{}chan}\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}\label{val-CML.recvEvt}
223    
224    
225  \begin{speccomment}  \begin{speccomment}
226  \item  \item
227    
228            These functions create event values to represent the \texttt{send}      and \texttt{recv} operations.\-     \end{speccomment}            These functions create event values to represent the {\cf \small send}          and {\cf \small recv} operations.     \end{speccomment}
229  \item {\index{sendPoll@sendPoll!CML@CML}}{\textbf{val}} {\tt sendPoll: \((\alpha\:\mathrm{chan}\:\verb,*,\:\alpha)\rightarrow \mathrm{bool}\)}\label{val-CML.sendPoll}  \item {\index{sendPoll@sendPoll!CML@\textcf{CML}}}{\kw{val}} {\cf sendPoll: \((\alpha\mtoksep{}\mbox{\cf{}chan}\mtoksep{}\verb,*,\mtoksep{}\alpha)\rightarrow \mbox{\cf{}bool}\)}\label{val-CML.sendPoll}
230    
231    
232  \begin{speccomment}  \begin{speccomment}
233  \item {\tt send (\textit{ch}, \textit{a})           }  \item {\cf \small send (\mbox{\cf \small \textit{ch}}, \mbox{\cf \small \textit{a}})           }
234  attempts to send the message \textit{a} on the synchronous channel \textit{ch}.\-         If this operation can complete without blocking the calling thread, then        the message is sent and {\tt true} is returned.\-       Otherwise, no communication is preformed and {\tt false} is returned.\-         This function is not recommended for general use; it is provided        as an efficiency aid for certain kinds of protocols.\-     \end{speccomment}  attempts to send the message \mbox{\cf \small \textit{a}} on the synchronous channel \mbox{\cf \small \textit{ch}}.       If this operation can complete without blocking the calling thread, then        the message is sent and {\cf \small true} is returned.          Otherwise, no communication is preformed and {\cf \small false} is returned.    This function is not recommended for general use; it is provided        as an efficiency aid for certain kinds of protocols.     \end{speccomment}
235  \item {\index{recvPoll@recvPoll!CML@CML}}{\textbf{val}} {\tt recvPoll: \(\alpha\:\mathrm{chan}\rightarrow \alpha\:\mathrm{option}\)}\label{val-CML.recvPoll}  \item {\index{recvPoll@recvPoll!CML@\textcf{CML}}}{\kw{val}} {\cf recvPoll: \(\alpha\mtoksep{}\mbox{\cf{}chan}\rightarrow \alpha\mtoksep{}\mbox{\cf{}option}\)}\label{val-CML.recvPoll}
236    
237    
238  \begin{speccomment}  \begin{speccomment}
239  \item {\tt recv\-Poll \textit{ch}           }  \item {\cf \small recv\-Poll \mbox{\cf \small \textit{ch}}           }
240  attempts to receive a message from the channel \textit{ch}.\-     If there is no other thread offering to \texttt{send} a message         on \textit{ch}, then this returns       \texttt{NONE}, otherwise it     returns \texttt{SOME} wrapped           around the message.\-           This function is not recommended for general use; it is provided        as an efficiency aid for certain kinds of protocols.\-     \end{speccomment}  attempts to receive a message from the channel \mbox{\cf \small \textit{ch}}.     If there is no other thread offering to {\cf \small send} a message     on \mbox{\cf \small \textit{ch}}, then this returns     {\cf \small NONE}, otherwise it         returns {\cf \small SOME} wrapped       around the message.     This function is not recommended for general use; it is provided        as an efficiency aid for certain kinds of protocols.     \end{speccomment}
241  \item {\index{wrap@wrap!CML@CML}}{\textbf{val}} {\tt wrap: \((\alpha\:\mathrm{event}\:\verb,*,(\alpha\rightarrow \beta))\rightarrow \beta\:\mathrm{event}\)}\label{val-CML.wrap}  \item {\index{wrap@wrap!CML@\textcf{CML}}}{\kw{val}} {\cf wrap: \((\alpha\mtoksep{}\mbox{\cf{}event}\mtoksep{}\verb,*,(\alpha\rightarrow \beta))\rightarrow \beta\mtoksep{}\mbox{\cf{}event}\)}\label{val-CML.wrap}
242    
243    
244  \begin{speccomment}  \begin{speccomment}
245  \item {\tt wrap (\textit{ev}, \textit{f})           }  \item {\cf \small wrap (\mbox{\cf \small \textit{ev}}, \mbox{\cf \small \textit{f}})           }
246  wraps the post-synchronization action \textit{f} around the event         value \textit{ev}.\-     \end{speccomment}  wraps the post-synchronization action \mbox{\cf \small \textit{f}} around the event       value \mbox{\cf \small \textit{ev}}.     \end{speccomment}
247  \item {\index{wrapHandler@wrapHandler!CML@CML}}{\textbf{val}} {\tt wrapHandler: \((\alpha\:\mathrm{event}\:\verb,*,(\mathrm{exn}\rightarrow \alpha\:\mathrm{event}))\rightarrow \alpha\:\mathrm{event}\)}\label{val-CML.wrapHandler}  \item {\index{wrapHandler@wrapHandler!CML@\textcf{CML}}}{\kw{val}} {\cf wrapHandler: \((\alpha\mtoksep{}\mbox{\cf{}event}\mtoksep{}\verb,*,(\mbox{\cf{}exn}\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}))\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}\label{val-CML.wrapHandler}
248    
249    
250  \begin{speccomment}  \begin{speccomment}
251  \item {\tt wrap\-Handler (\textit{ev}, \textit{f})           }  \item {\cf \small wrap\-Handler (\mbox{\cf \small \textit{ev}}, \mbox{\cf \small \textit{f}})           }
252  wraps the exception handler function \textit{f} around the event          value \textit{ev}.\-    If, during execution of some post-synchronization action in     \textit{ev}, an exception is raised, it will be caught and passed       to \textit{f}.\-        Nesting of handlers works as would be expected: the innermost           handler is the one invoked.\-           Note that exceptions raised in the pre-synchronization actions in       \textit{ev} (i.\-e.\-, actions defined by \texttt{guard} and \texttt{with\-Nack})       are not handled by \textit{f}.\-     \end{speccomment}  wraps the exception handler function \mbox{\cf \small \textit{f}} around the event        value \mbox{\cf \small \textit{ev}}.    If, during execution of some post-synchronization action in     \mbox{\cf \small \textit{ev}}, an exception is raised, it will be caught and passed     to \mbox{\cf \small \textit{f}}.        Nesting of handlers works as would be expected: the innermost           handler is the one invoked.     Note that exceptions raised in the pre-synchronization actions in       \mbox{\cf \small \textit{ev}} (i.\-e., actions defined by {\cf \small guard} and {\cf \small with\-Nack})       are not handled by \mbox{\cf \small \textit{f}}.     \end{speccomment}
253  \item {\index{guard@guard!CML@CML}}{\textbf{val}} {\tt guard: \((\mathrm{unit}\rightarrow \alpha\:\mathrm{event})\rightarrow \alpha\:\mathrm{event}\)}\label{val-CML.guard}  \item {\index{guard@guard!CML@\textcf{CML}}}{\kw{val}} {\cf guard: \((\mbox{\cf{}unit}\rightarrow \alpha\mtoksep{}\mbox{\cf{}event})\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}\label{val-CML.guard}
254    
255    
256  \begin{speccomment}  \begin{speccomment}
257  \item {\tt guard \textit{f}           }  \item {\cf \small guard \mbox{\cf \small \textit{f}}           }
258  creates \textit{delayed} event value from the function \textit{f}.\-      When the resulting event value is synchronized on, the function         \textit{f} will be evaluated and the resulting event value will be      used in its place in the synchronization.\-     This provides a mechanism for implementing pre-synchronization          actions, such as sending a request to a server.\-     \end{speccomment}  creates \textit{delayed} event value from the function \mbox{\cf \small \textit{f}}.      When the resulting event value is synchronized on, the function         \mbox{\cf \small \textit{f}} will be evaluated and the resulting event value will be    used in its place in the synchronization.       This provides a mechanism for implementing pre-synchronization          actions, such as sending a request to a server.     \end{speccomment}
259  \item {\index{withNack@withNack!CML@CML}}{\textbf{val}} {\tt withNack: \((\mathrm{unit}\;\mathrm{event}\rightarrow \alpha\:\mathrm{event})\rightarrow \alpha\:\mathrm{event}\)}\label{val-CML.withNack}  \item {\index{withNack@withNack!CML@\textcf{CML}}}{\kw{val}} {\cf withNack: \((\mbox{\cf{}unit}\;\mbox{\cf{}event}\rightarrow \alpha\mtoksep{}\mbox{\cf{}event})\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}\label{val-CML.withNack}
260    
261    
262  \begin{speccomment}  \begin{speccomment}
263  \item {\tt with\-Nack \textit{f}           }  \item {\cf \small with\-Nack \mbox{\cf \small \textit{f}}           }
264  creates \textit{delayed} event value from the function \textit{f}.\-      As in the case of \texttt{guard}, the function \textit{f} will be evaluated     at synchronization time and the resulting event value will be           used in its place in the synchronization.\-     Furthermore, when \textit{f} is evaluated, it is passed a \textit{negative      acknowledgement} event as an argument.\-        If the event value that is returned from the evaluation of \textit{f}           is \emph{not} chosen in the synchronization, then the negative          event will be enabled.\-        This provides a mechanism for informing servers that a client has       aborted a transaction.\-     \end{speccomment}  creates \textit{delayed} event value from the function \mbox{\cf \small \textit{f}}.      As in the case of {\cf \small guard}, the function \mbox{\cf \small \textit{f}} will be evaluated       at synchronization time and the resulting event value will be           used in its place in the synchronization.       Furthermore, when \mbox{\cf \small \textit{f}} is evaluated, it is passed a \textit{negative    acknowledgement} event as an argument.          If the event value that is returned from the evaluation of \mbox{\cf \small \textit{f}}         is \emph{not} chosen in the synchronization, then the negative          event will be enabled.          This provides a mechanism for informing servers that a client has       aborted a transaction.     \end{speccomment}
265  \item {\index{choose@choose!CML@CML}}{\textbf{val}} {\tt choose: \(\alpha\:\mathrm{event}\;\mathrm{list}\rightarrow \alpha\:\mathrm{event}\)}\label{val-CML.choose}  \item {\index{choose@choose!CML@\textcf{CML}}}{\kw{val}} {\cf choose: \(\alpha\mtoksep{}\mbox{\cf{}event}\;\mbox{\cf{}list}\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}\label{val-CML.choose}
266    
267    
268  \begin{speccomment}  \begin{speccomment}
269  \item {\tt choose \textit{l}           }  \item {\cf \small choose \mbox{\cf \small \textit{l}}           }
270  constructs an event value that represents the non-deterministic           choice of the events in the list \textit{l}.\-     \end{speccomment}  constructs an event value that represents the non-deterministic           choice of the events in the list \mbox{\cf \small \textit{l}}.     \end{speccomment}
271  \item {\index{sync@sync!CML@CML}}{\textbf{val}} {\tt sync: \(\alpha\:\mathrm{event}\rightarrow \alpha\)}\label{val-CML.sync}  \item {\index{sync@sync!CML@\textcf{CML}}}{\kw{val}} {\cf sync: \(\alpha\mtoksep{}\mbox{\cf{}event}\rightarrow \alpha\)}\label{val-CML.sync}
272    
273    
274  \begin{speccomment}  \begin{speccomment}
275  \item {\tt sync \textit{ev}           }  \item {\cf \small sync \mbox{\cf \small \textit{ev}}           }
276  synchronizes the calling thread on the event \textit{ev}.\-     \end{speccomment}  synchronizes the calling thread on the event \mbox{\cf \small \textit{ev}}.     \end{speccomment}
277  \item {\index{select@select!CML@CML}}{\textbf{val}} {\tt select: \(\alpha\:\mathrm{event}\;\mathrm{list}\rightarrow \alpha\)}\label{val-CML.select}  \item {\index{select@select!CML@\textcf{CML}}}{\kw{val}} {\cf select: \(\alpha\mtoksep{}\mbox{\cf{}event}\;\mbox{\cf{}list}\rightarrow \alpha\)}\label{val-CML.select}
278    
279    
280  \begin{speccomment}  \begin{speccomment}
281  \item {\tt select \textit{evs}           }  \item {\cf \small select \mbox{\cf \small \textit{evs}}           }
282  synchronizes on the choice of a list of event values.\-           This is semantically equivalant to:  synchronizes on the choice of a list of event values.     This is semantically equivalant to:
283  \begin{code}  \begin{code}
284              sync (choose \textit{evs})              sync (choose \mbox{\cf \small \textit{evs}})
285    
286  \end{code}  \end{code}
287            but is more efficient.\-     \end{speccomment}            but is more efficient.     \end{speccomment}
288  \item {\index{never@never!CML@CML}}{\textbf{val}} {\tt never: \(\alpha\:\mathrm{event}\)}\label{val-CML.never}  \item {\index{never@never!CML@\textcf{CML}}}{\kw{val}} {\cf never: \(\alpha\mtoksep{}\mbox{\cf{}event}\)}\label{val-CML.never}
289    
290    
291  \begin{speccomment}  \begin{speccomment}
292  \item {\tt never           }  \item {\cf \small never           }
293  is an event value that is never enabled for synchronization.\-    It is semantically equivalant to the expression:  is an event value that is never enabled for synchronization.      It is semantically equivalant to the expression:
294  \begin{code}  \begin{code}
295              choose []              choose []
296    
297  \end{code}  \end{code}
298       \end{speccomment}       \end{speccomment}
299  \item {\index{alwaysEvt@alwaysEvt!CML@CML}}{\textbf{val}} {\tt alwaysEvt: \(\alpha\rightarrow \alpha\:\mathrm{event}\)}\label{val-CML.alwaysEvt}  \item {\index{alwaysEvt@alwaysEvt!CML@\textcf{CML}}}{\kw{val}} {\cf alwaysEvt: \(\alpha\rightarrow \alpha\mtoksep{}\mbox{\cf{}event}\)}\label{val-CML.alwaysEvt}
300    
301    
302  \begin{speccomment}  \begin{speccomment}
303  \item {\tt always\-Evt \textit{a}           }  \item {\cf \small always\-Evt \mbox{\cf \small \textit{a}}           }
304  creates an event value that is always enabled, and that returns           the value \textit{a} upon synchronization.\-     \end{speccomment}  creates an event value that is always enabled, and that returns           the value \mbox{\cf \small \textit{a}} upon synchronization.     \end{speccomment}
305  \item {\index{timeOutEvt@timeOutEvt!CML@CML}}{\textbf{val}} {\tt timeOutEvt: \(\mathrm{Time}.\mathrm{time}\rightarrow \mathrm{unit}\;\mathrm{event}\)}\label{val-CML.timeOutEvt}  \item {\index{timeOutEvt@timeOutEvt!CML@\textcf{CML}}}{\kw{val}} {\cf timeOutEvt: \(\mbox{\cf{}Time}.\mbox{\cf{}time}\rightarrow \mbox{\cf{}unit}\;\mbox{\cf{}event}\)}\label{val-CML.timeOutEvt}
306    
307    
308  \begin{speccomment}  \begin{speccomment}
309  \item {\tt time\-Out\-Evt \textit{t}           }  \item {\cf \small time\-Out\-Evt \mbox{\cf \small \textit{t}}           }
310  creates an event value that becomes enabled at the time           interval \textit{t} after synchronization.\-    For example, the expression:  creates an event value that becomes enabled at the time           interval \mbox{\cf \small \textit{t}} after synchronization.    For example, the expression:
311  \begin{code}  \begin{code}
312              sync (time\-Out\-Evt (Time.fromSeconds 1))              sync (time\-Out\-Evt (Time.fromSeconds 1))
313    
314  \end{code}  \end{code}
315            will delay the calling thread for one second.\-         Note that the specified time interval is actually a minimum     waiting time, and the delay may be longer.\-     \end{speccomment}            will delay the calling thread for one second.           Note that the specified time interval is actually a minimum     waiting time, and the delay may be longer.     \end{speccomment}
316  \item {\index{atTimeEvt@atTimeEvt!CML@CML}}{\textbf{val}} {\tt atTimeEvt: \(\mathrm{Time}.\mathrm{time}\rightarrow \mathrm{unit}\;\mathrm{event}\)}\label{val-CML.atTimeEvt}  \item {\index{atTimeEvt@atTimeEvt!CML@\textcf{CML}}}{\kw{val}} {\cf atTimeEvt: \(\mbox{\cf{}Time}.\mbox{\cf{}time}\rightarrow \mbox{\cf{}unit}\;\mbox{\cf{}event}\)}\label{val-CML.atTimeEvt}
317    
318    
319  \begin{speccomment}  \begin{speccomment}
320  \item {\tt at\-Time\-Evt \textit{t}           }  \item {\cf \small at\-Time\-Evt \mbox{\cf \small \textit{t}}           }
321  creates an event value that becomes enabled at the specified time         \textit{t}.\-     \end{speccomment}  creates an event value that becomes enabled at the specified time         \mbox{\cf \small \textit{t}}.           For example, the expression:
322    \begin{code}
323                sync (at\-Time\-Evt (Date.toTime (Date.date {\tt\{}
324                    year = 2000, month = Date.Jan, day = 0,
325                    hour = 0, minute = 0, second = 0,
326                    offset = NONE
327                  {\tt\}})))
328    
329    \end{code}
330              blocks the calling thread until the beginning of the year 2000.     \end{speccomment}
331  \end{descr}  \end{descr}
332    
333  \begin{seealso}  \begin{seealso}
334  \texttt{Option}, \texttt{Time}  {\cf Option}, {\cf Time}
335  \end{seealso}  \end{seealso}

Legend:
Removed from v.843  
changed lines
  Added in v.844

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0