wrap_abort の話 ()
OCaml (Concurrent ML?) の Event.wrap_abort という関数はちょっと面白い.
val wrap_abort : 'a event -> (unit -> unit) -> 'a event
wrap_abort ev fn returns the event that performs the same communications as ev, but if it is not selected the function fn is called after the synchronization.
selectで選ばれなかった場合の処理を型unit->unitで渡せる. MilnerのCCSにはこういう演算子はなかったと思うけど,まあ適当に定義してみる. (ちゃんと探せばあるんだろうけど頭の体操的な)
プロセス構文の修正
を
と書き換える.
ここで は 直観的には 動作後にに遷移するが 選択されない場合のみ に遷移するプロセス.
従来の は, の略記とする ( は終了したプロセス).