実践 CommonLisp(1)

| コメント(0) | トラックバック(0)
xyzzy lisp でサンプルを実行してみる。
そのままでは動作しない部分がある。

3章P24、prompt-for-cd。
prompt 回りはミニバッファを利用させてもらう。
y-or-n-p は、自動で (y or n) が表示される。

(defun prompt-for-cd()
    (make-cd
     (read-string "TITLE: ")
     (read-string "ARTIST: ")
     (read-integer "RATING: ")
     (y-or-n-p "RIPPED: ")))


3章P35、make-comparisons-list。
loop while やら collecting やらが通らない。
再帰的にコールしてつなげてくことにする。

(defun make-comparisons-list (fields)
    (if fields
            (cons (make-comparison-expr (first fields) (second fields))
                        (make-comparisons-list (rest (rest fields))))
        nil))

トラックバック(0)

トラックバックURL: http://mikagamikobo.com/cgi/MTOS-4.21-ja/mt-tb.cgi/17

コメントする

2012年1月

1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

アーカイブ