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

関数地獄:C編 追記

ラッピング方式をちょっとだけ考えてみた。 typedef void *combinator; #define APPLY(f, x) (((combinator(*)(combinator))f)(x)) combinator s(combinator f, combinator g, combinator x) { return APPLY(APPLY(f, x), APPLY(g, x)); }冗長になったが、ま…

dslinuxにperlが追加されたらしい

http://www.dslinux.org/blogs/pepsiman/?p=77 http://kineox.free.fr/DS/ これで、不完全なbusyboxのshを使わずにスクリプトを書く事ができる。 busyboxが悪いのか、dslinuxの方が悪いのかは知らないが、とにかくdslinuxの/bin/shは、cwdが全く考慮されてな…

関数地獄:C編

今日の結論: Cは不完全言語だ(多分)。 諸事情により、C文法でコンビネータを書く必要がでてきた。 とりあえずSコンビネータを書いてみた(追記: よく考えたらこれ、カリー化忘れてる)。 combinator s(combinator f, combinator g, combinator x) { return f(x…