2008-02-23
名前つきlet
WikiPediaの英語のSchemeのページのcall/cc の例で、let がどうなってるのかわからなかった
(let loop ((lst lst) (sum 0)) (... (loop (cdr lst) (+ sum (car lst)))))
let って (let ((var val) ...) という形しか知らなかったので、なにこれ?という感じ。名前からなんとなく関数に名前をつけてるんだろうとはわかるんだけど。404 Not Found 名前つきlet ですか。自動的に lambda になるんですね。
Practical Common Lisp第12章に出てくるマトリクスのパロディの件
PCL |
http://www.gigamonkeys.com/book/they-called-it-lisp-for-a-reason-list-processing.html
Spoon Boy: Do not try and bend the list. That's impossible. Instead . . . only try to realize the truth.
Neo: What truth?
Spoon Boy: There is no list.
Neo: There is no list?
Spoon Boy: Then you'll see that it is not the list that bends; it is only yourself.
マトリクスが元ネタらしいけど、なにを言ってるのかわからねー。
Spoon boy: Do not try and bend the spoon. That's impossible. Instead... only try to realize the truth.
Neo: What truth?
Neo: There is no spoon?
Spoon boy: Then you'll see, that it is not the spoon that bends, it is only yourself.
The Matrix (1999) - Memorable quotes
オラクルのリビングでスプーンを曲げる訓練をしていた、仏教徒風の少年。
彼は「ここにはスプーンはない。曲げるのはスプーンではなく自分自身なんだ!!」と話す。
禅の公案
〈二人の僧が風にたなびく旗を見て議論していた。
「旗が動いている!」「いや、風が動いている。」
禅の師匠・六祖慧能はこれを聞いて
「動いているのは旗でもない、風でもない。諸君の心が動いているのだ!」と述べた。〉
マトリックス2
- リストなんてものはない。cons セルだ