...ing logging 4.0

はてなブログに移行しました。D言語の話とかいろいろ。

2011-12-01から1ヶ月間の記事一覧

=>

あけおめ. import std.stdio; int f(alias F)(int x) { return F(x); } int g(int delegate(int) dg, int x) { return dg(x); } int h(int function(int) dg, int x) { return dg(x); } void main() { writeln(f!(x => x + 1)(1)); writeln(g(x => x + 1, 1…

愚直に書くのが最速だった

final class Lexer { private const string source; this(in string source) { this.source = source; } const(string)[] lex() const { static string[] f(string line) { auto app2 = appender!string(); app2.put(line); app2.put(","); app2.put(TOKEN_E…

何だかうまく書けない

final class Lexer { class LexerThread : Thread { private const(string)[] lines; private Appender!(string[]) app; this(const(string)[] lines) { this.lines = lines; app = appender!(string[])(); app.reserve(10000); super(&run); } void run() {…