この章では、functions, macros and special operators の違いは気にするなと。
CDs and Records
symbolは、まあ名前。
keyword symbolは、symbolのうち、":"から始まるもの。
Filing CDs
特記事項なし。
Looking at the Database Contents
formatって、エラくLoopするな。試す。
CL-USER> (list *db* *db*)
(((:TITLE "Home" :ARTIST "Dixie Chicks" :RATING 9 :RIPPED T)
(:TITLE "Fly" :ARTIST "Dixie Chicks" :RATING 8 :RIPPED T)
(:TITLE "Roses" :ARTIST "kathy Mattea" :RATING 7 :RIPPED T))
((:TITLE "Home" :ARTIST "Dixie Chicks" :RATING 9 :RIPPED T)
(:TITLE "Fly" :ARTIST "Dixie Chicks" :RATING 8 :RIPPED T)
(:TITLE "Roses" :ARTIST "kathy Mattea" :RATING 7 :RIPPED T)))
CL-USER> (format t "~{~a:~10t~a~%~}~%" (list *db* *db*))
((TITLE Home ARTIST Dixie Chicks RATING 9 RIPPED T)
(TITLE Fly ARTIST Dixie Chicks RATING 8 RIPPED T)
(TITLE Roses ARTIST kathy Mattea RATING 7 RIPPED T)): ((TITLE
Home
ARTIST
Dixie Chicks
RATING
9
RIPPED
T)
(TITLE
Fly
ARTIST
Dixie Chicks
RATING
8
RIPPED
T)
(TITLE
Roses
ARTIST
kathy Mattea
RATING
7
RIPPED
T))
NIL
CL-USER>
なる。修正。
CL-USER> (format t "~{~{~{~a:~10t~a~%~}~%~}~}" (list *db* *db*))
TITLE: Home
ARTIST: Dixie Chicks
RATING: 9
RIPPED: T
TITLE: Fly
ARTIST: Dixie Chicks
RATING: 8
RIPPED: T
TITLE: Roses
ARTIST: kathy Mattea
RATING: 7
RIPPED: T
TITLE: Home
ARTIST: Dixie Chicks
RATING: 9
RIPPED: T
TITLE: Fly
ARTIST: Dixie Chicks
RATING: 8
RIPPED: T
TITLE: Roses
ARTIST: kathy Mattea
RATING: 7
RIPPED: T
NIL
なんぞ。
これ、ミニ言語なんですね。
Improving the User Interaction
CL-USER> (defun prompt-read (prompt)
(format *query-io* "~a: " prompt)
(force-output *query-io*)
(read-line *query-io*))
PROMPT-READ
*query-io*って?
REPLで調べると、TWO-WAY-STREAM なんですね。
Saving and Loading the Database
read/print equivalenceを保証するには、with-standard-io-syntaxを使う。
疲れがでてきたので、休憩。
0 件のコメント:
コメントを投稿