Changeset 189 for docs/trunk
- Timestamp:
- Jan 24, 2008, 6:28:32 PM (18 years ago)
- Author:
- neil.c.c.brown
- Message:
-
Added an explanation of what the example assignment-flattening code does
- File:
-
- 1 edited
- docs/trunk/hacking-guide/tock-intro.tex (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
docs/trunk/hacking-guide/tock-intro.tex
r188 r189 278 278 \end{lstlisting} 279 279 280 (追記) First, a description of what the code does. (追記ここまで) 281 (追記) The first line gets the type of the variables on the LHS and stores this list of types in `ts'. (追記ここまで) 282 (追記) `specs' is a list of specifications of nonce variables to be assignment temporaries, one for each (追記ここまで) 283 (追記) type in the type list (`ts'). `temps' is the list of Variable items. `first' is the list (追記ここまで) 284 (追記) of assignments from the RHS of the original assignment to the temporaries. `second' is the list (追記ここまで) 285 (追記) of assignments from the temporaries to the original LHS. Finally, we use the foldl function (追記ここまで) 286 (追記) to nest the specifications, and make a sequential list of the assignments (`first' then `second'). (追記ここまで) 287 (追記) (追記ここまで) 280 288 The type of this function is to take a \lstinline|Process| (the \lstinline |A.| is simply because it's an AST 281 289 fragment; the AST module is always imported as A) and returns a monadic action in the PassM monad that will yield … … 350 358 viewed as an analogue to C or Java's return statement. 351 359 352 Note that (削除) you there is nor (削除ここまで)really an opposite of the return function (something of type \lstinline|m a -> a|).360 Note that (追記) there is not (追記ここまで) really an opposite of the return function (something of type \lstinline|m a -> a|). 353 361 Values can never really be `freed' from the monad; everything around them just gets lifted inside. 354 362 355 %TODO (削除) explain what the code actually does, too! (削除ここまで)363 %TODO (追記) this is not really true for Maybe and Either... (追記ここまで) 356 364 357 365 \subsection{The PassM monad}
Note:
See TracChangeset
for help on using the changeset viewer.