Skip to content

Instantly share code, notes, and snippets.

View takahisa's full-sized avatar

Takahisa Watanabe takahisa

  • Cybozu, Inc
  • Tokyo, Japan
View GitHub Profile
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向けのフレームワーク

Ioでブログシステム的なものが作りたかった

##今回使おうとしたIo向けのフレームワーク

  • Iota
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
@takahisa
takahisa / gist:3859029
Created October 9, 2012 14:06
imagine the future. ノムリッシュ翻訳版
件の峰に 異界の渦パンデモニウムも
二度とない現世(現時代《いま》)を かたちにして
神に見放された断罪者は――神は如何様にして 彷徨いながらも我らの
聖域(ここ)に来た意味も
君は見たか 果ては振り向き
君は視たか そっと我らに告げる
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 }