In terms of unreasonable effectiveness, the transformation to continuation-passing style (CPS) ranks with the Y combinator. During compilation, high-level control constructs ranging from coroutines and exceptions to while loops and break statements steadily desugar into a mixture of two constructs: calls to functions and calls to continuations. Then, during CPS transformation, continuations desuga
昨日のエントリに Rui さんからコメントを頂きました。ありがとうございます。 私もなんだか同じイメージを持ってます。静的スコープでオブジェクトの寿命が永遠(無限エクステント)というのがまず初めにあって、その結果クロージャがあるという印象。 私が漠然と感じているクロージャへの解釈を、一言で表現されている様に思いました。 ここで無限エクステントに触れられていますが、実は私も、先のエントリを書いたとき、クロージャを副次的に作り出している仕様の一つとして、無限 (実装上は有限になるのでしょうが) エクステントを挙げようとは思ったのです。 しかし、レキシカルスコープとブロックの階層化 (手続きをトップレベル以外でも定義可能とか、lambda はどこでも書けるとか) を挙げることで、必然的に無限エクステントが求められることになると考えて、そちらを優先したのでした。 そして、その考えが、 例えば、レキ
ISLISP には動的変数 (ダイナミックスコープの変数) の仕組みがある。 名前空間が分離されており、参照には特殊演算子 dynamic を用いる。 この方式であれば Scheme で再現するのは簡単そうだと思えたのでやってみた。 (library (dynamic-variables) (export dynamic-let defdynamic dynamic set-dynamic) (import (rnrs) (rnrs control (6)) (rnrs exceptions (6)) (rnrs conditions (6)) (rnrs mutable-pairs (6))) (define dynamic-chain '()) (define global-dynamic-variables '()) (define (add-dynamic-variables va
The L.i.S.P book and code The exact title of this book stands for "Lisp in Small Pieces". This book covers Lisp, Scheme and other related dialects, their interpretation, semantics and compilation. To sum it up in a few figures: 500 pages, 11 chapters, 11 interpreters and 2 compilers. This book was first written in French. It was published by InterÉditions, under title "Les Langages Lisp". See exac
lambdaのshorter-name( http://blog.practical-scheme.net/gauche/20100428-shorter-names )は便利な機能なので、nmoshにはコッソリ入れておくことにする。 ^ ^は以前reader macroで実装していたのを、単にsyntax-rulesに変更した。 (define-syntax ^ (syntax-rules () ((_ args ...) (lambda args ...)))) 以前( http://d.hatena.ne.jp/mjt/20091207/p1#c1260348087 )のコードそのまま。 ^x 会社で使っているnmoshでは、この機能をexpanderを変更する形で実装している。というのも、syntax-rulesでは新たなシンボルの導入が事実上できないので、このような"本来存在しな
Functional Programming in Scheme With Web Programming ExamplesKurt Nørmark Department of Computer Science, Aalborg University, Denmark Title page Abstract All exercises in this material All references in this material
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く