comparison src/mono_util.sml @ 1021:7a4a55e05081

Use call/cc for recv and sleep
author Adam Chlipala <adamc@hcoop.net>
date Sun, 25 Oct 2009 15:29:21 -0400
parents dfe34fad749d
children 217eb87dde31
comparison
equal deleted inserted replaced
1020:dfe34fad749d 1021:7a4a55e05081
366 S.bind2 (mfe ctx s, 366 S.bind2 (mfe ctx s,
367 fn s' => 367 fn s' =>
368 S.map2 (mft t, 368 S.map2 (mft t,
369 fn t' => 369 fn t' =>
370 (EServerCall (s', t', eff), loc))) 370 (EServerCall (s', t', eff), loc)))
371 | ERecv (s, ek, t) => 371 | ERecv (s, t) =>
372 S.bind2 (mfe ctx s, 372 S.bind2 (mfe ctx s,
373 fn s' => 373 fn s' =>
374 S.bind2 (mfe ctx ek, 374 S.map2 (mft t,
375 fn ek' => 375 fn t' =>
376 S.map2 (mft t, 376 (ERecv (s', t'), loc)))
377 fn t' => 377 | ESleep s =>
378 (ERecv (s', ek', t'), loc)))) 378 S.map2 (mfe ctx s,
379 | ESleep (s, ek) =>
380 S.bind2 (mfe ctx s,
381 fn s' => 379 fn s' =>
382 S.map2 (mfe ctx ek, 380 (ESleep s', loc))
383 fn ek' => 381
384 (ESleep (s', ek'), loc))) 382 | ESpawn s =>
383 S.map2 (mfe ctx s,
384 fn s' =>
385 (ESpawn s', loc))
385 386
386 and mfmode ctx mode = 387 and mfmode ctx mode =
387 case mode of 388 case mode of
388 Attribute => S.return2 mode 389 Attribute => S.return2 mode
389 | Script => S.return2 mode 390 | Script => S.return2 mode