Source of Nothingness - 実践CLを読了

* 実践CLを読了

一番の収穫はCLOSについての理解が深まったこと。
xyzzyで使えないものだから、ちゃんと勉強したことが無くて:beforeとか:afterとかよく分かってなかったんだけど、やっと分かった。(とりあえず使ってみようと思うくらいには)
メソッド結合かぁ〜 よく考えたもんだなぁ〜
C++やJavaなんかのメソッドがクラスに属しているオブジェクト指向とは全くの別物だ。頭を切り替えて使わないといけない。

帰省中に付箋を付けながら読んでいたので、拾い上げておく。

短くなっているかどうかは微妙な気が… フィールドが増えれば差が出てくるし、まあいいか。
(defun where (&key title artist rating (ripped nil ripped-p))
  #'(lambda (cd)
      (and
       (if title    (equal (getf cd :title)  title)  t)
       (if artist   (equal (getf cd :artist) artist) t)
       (if rating   (equal (getf cd :rating) rating) t)
       (if ripped-p (equal (getf cd :ripped) ripped) t))))

(defun make-comparisons-expr (field value)
  `(equal (getf cd ,field) ,value))
(defun make-comparisons-list (fields)
  (loop while fields
        collecting (make-comparisons-expr (pop fields) (pop fields))))
(defmacro where (&rest clauses)
  `#'(lambda (cd) (and ,@(make-comparisons-list clauses))))

Type SHORT-FLOAT, SINGLE-FLOAT, DOUBLE-FLOAT, LONG-FLOAT
http://www.lispworks.com/documentation/HyperSpec/Body/t_short_.htm
最小しか使用にしかないということは全部 LONG-FLOAT と同じでもありということか。

3.1.2.1.2.1 Special Forms
http://www.lispworks.com/documentation/HyperSpec/Body/03_ababa.htm

http://www.gigamonkeys.com/book/macros-standard-control-constructs.html
Another important class of language constructs that are defined using macros are all the definitional constructs such as DEFUN, DEFPARAMETER, DEFVAR, and others. In Chapter 24 you'll define your own definitional macros that will allow you to concisely write code for reading and writing binary data.

http://www.gigamonkeys.com/book/collections.html
関数名じゃなかった。

http://www.gigamonkeys.com/book/beyond-lists-other-uses-for-cons-cells.html
As you saw in the previous chapter, the list data type is an illusion created by a set of functions that manipulate cons cells.

The remaining set-theoretic functions provide bulk operations: INTERSECTION, UNION, SET-DIFFERENCE, and SET-EXCLUSIVE-OR.

http://www.gigamonkeys.com/book/files-and-file-io.html
The other kinds of streams defined in the language standard provide various kinds of stream "plumbing," allowing you to plug together streams in almost any configuration.

http://www.gigamonkeys.com/book/the-special-operators.html
There are two ways you're most likely to use EVAL-WHEN. One is if you want to write macros that need to save some information at compile time to be used when generating the expansion of other macro forms in the same file.

update : 2008-08-24 (Sun) 18:47:49