- Ioの普及のために入門サイト的ブログが作りたかった
- どうせならブログもIoで書きたい
- インスパイア元 [http://tanakh.jp/posts/2011-11-05-haskell-infra.html]
##Io向けのフレームワーク
| Enumerator := Object clone do( | |
| current := method(Exception raise("not implemented")) | |
| moveNext := method(Exception raise("not implemented")) | |
| reset := method(Exception raise("not implemented")) | |
| ) | |
| Enumerable := Object clone do( | |
| enumerator := method(Exception raise("not implemented")) | |
| ) |
| let ws = [' ' '\t' '\r' '\n'] | |
| let digit = ['0'-'9'] | |
| let lower = ['a'-'z'] | |
| let upper = ['A'-'Z'] | |
| let letter = lower | upper | |
| let newline = "\r\n" | ['\r' '\n'] |
##Io向けのフレームワーク
##今回使おうとしたIo向けのフレームワーク
| public static Parser<TToken, IEnumerable<TResult>> Sequence<TToken, TResult>( | |
| IEnumerable<Parser<TToken, TResult>> parsers) | |
| { | |
| if (parsers == null) | |
| throw new ArgumentNullException("parsers"); | |
| return stream => | |
| { | |
| try | |
| { |
| static Continuation<Unit,Unit> Write(String s){ | |
| return k => { | |
| Console.WriteLine(s); | |
| return k(Unit.Instance); | |
| }; | |
| } | |
| static void Main(String[] args){ |
| public partial class Tokenizer | |
| { | |
| static Tokenizer() | |
| { | |
| var space = Chars.OneOf('\u0020', '\u0009', '\u000a', '\u000d'); | |
| var newline = Combinator.Choice( | |
| Chars.Sequence("\r\n"), | |
| Chars.Sequence("\r"), | |
| Chars.Sequence("\n")); |
| fact(N) :- N > 0 | N * fact(N-1) ; | |
| fact(0) :- true | 0 ; | |
| ---- | |
| ldobj | |
| ldobj | |
| == fact/1 ====== | |
| stloc | |
| ldc.i4 |
| 件の峰に 異界の渦パンデモニウムも | |
| 二度とない現世(現時代《いま》)を かたちにして | |
| 神に見放された断罪者は――神は如何様にして 彷徨いながらも我らの | |
| 聖域(ここ)に来た意味も | |
| 君は見たか 果ては振り向き | |
| 君は視たか そっと我らに告げる | |
| Imagine the future | |
| We shall go together |
| Couldn't match expected type `ClockTime' | |
| with actual type `time-1.4:Data.Time.Clock.UTC.UTCTime' | |
| In the first argument of `isObsolete', namely `timeStamp' | |
| In a stmt of a 'do' block: isObsolete timeStamp depends | |
| In the expression: | |
| do { timeStamp <- getModificationTime file; | |
| isObsolete timeStamp depends } |