Context Navigation


Changeset 189 for docs/trunk


Ignore:
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

Legend:

Unmodified
Added
Removed
  • docs/trunk/hacking-guide/tock-intro.tex

    r188 r189
    278278\end{lstlisting}
    279279
    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(追記) (追記ここまで)
    280288The type of this function is to take a \lstinline|Process| (the \lstinline |A.| is simply because it's an AST
    281289fragment; the AST module is always imported as A) and returns a monadic action in the PassM monad that will yield
    350358viewed as an analogue to C or Java's return statement.
    351359
    352Note that (削除) you there is nor (削除ここまで) really an opposite of the return function (something of type \lstinline|m a -> a|).
    360Note that (追記) there is not (追記ここまで) really an opposite of the return function (something of type \lstinline|m a -> a|).
    353361Values can never really be `freed' from the monad; everything around them just gets lifted inside.
    354362
    355%TODO (削除) explain what the code actually does, too! (削除ここまで)
    363%TODO (追記) this is not really true for Maybe and Either... (追記ここまで)
    356364
    357365\subsection{The PassM monad}
Note: See TracChangeset for help on using the changeset viewer.

AltStyle によって変換されたページ (->オリジナル) /