2006-04-12から1日間の記事一覧

Concurrent Clean : 大域脱出

よく考えたら、大域脱出も無名関数でできる。 Start w = w --> stdio --> \(f,w) = "abcdef" --> \(s) = f --> fwrites "n = " --> fwritei (size s) --> fwrites "\n10 < n => abort\n" --> if (10 < size s) (fwrites "abort!") \f = f --> fwrites s --> …

Concurrent Clean : 大域脱出2

tryという関数を作ってみた。 ::Try a b = Break a | Continue b try f g x :== case f x of Break a = a Continue b = g b Start w = w --> stdio --> \(f,w) = ([],f,w) --> try check \(f,w) = f --> fwrites "hello world" --> flip fclose w --> \(ok,w…