トップ «前の日記(2009-09-08) 最新 次の日記(2009-09-10)» 編集

Route 477



2009-09-09

[scheme][english] R6RS仕様の英文をLisp的に読み解いてみる

例外のところを読んでいるのですが、複雑すぎて意味が分からない英文が。

Raises a non-continuable exception by invoking the current exception handler on obj. The handler is called with a continuation whose dynamic environment is that of the call to raise, except that the current exception handler is the one that was in place when the handler being called was installed.

[r6rs-libより引用]

Lisp的にインデントしてみると、一文目は

(Raises a non-continuable exception
  (by invoking the current exception handler on obj)).

こうですよね。問題は二文目。

(The handler is called with (a continuation
                              (whose dynamic environment
                                is
                                (that of (the call to raise)))),
  (except that
    (the current exception handler
      is
      (the one
        (that was in place
          (when (the handler being called) was installed)))))).

こう?

  • (((raiseの呼び出し)と同じ動的環境)を持つ継続)の元で、handlerを呼び出す
  • ただし、カレント例外ハンドラは((handlerがカレント例外ハンドラに設定された時点)のカレント例外ハンドラ)とする

木構造を書き下す手段としてS式はなかなか優れているな。括弧があるので、配置の自由度が高い。