Adjusted indentation.

svn: r11285
This commit is contained in:
Danny Yoo 2008-08-15 20:04:57 +00:00
parent cd03bb635e
commit 5d9410c058
2 changed files with 13 additions and 12 deletions

View File

@ -71,10 +71,11 @@
(define (post-comments p) (define (post-comments p)
(local [(define (row->comment a-row) (local [(define (row->comment a-row)
(vector-ref a-row 0)) (vector-ref a-row 0))
(define rows (sqlite:select (define rows
(blog-db (post-blog p)) (sqlite:select
(format "SELECT content FROM comments WHERE pid = '~a'" (blog-db (post-blog p))
(post-id p))))] (format "SELECT content FROM comments WHERE pid = '~a'"
(post-id p))))]
(cond (cond
[(empty? rows) empty] [(empty? rows) empty]
[else (map row->comment (rest rows))]))) [else (map row->comment (rest rows))])))

View File

@ -990,10 +990,10 @@ We can now write the code to initialize a @scheme[blog] structure:
(define the-blog (make-blog db)) (define the-blog (make-blog db))
(with-handlers ([exn? void]) (with-handlers ([exn? void])
(sqlite:exec/ignore db (sqlite:exec/ignore db
(string-append (string-append
"CREATE TABLE posts" "CREATE TABLE posts "
"(id INTEGER PRIMARY KEY," "(id INTEGER PRIMARY KEY,"
"title TEXT, body TEXT)")) "title TEXT, body TEXT)"))
(blog-insert-post! (blog-insert-post!
the-blog "First Post" "This is my first post") the-blog "First Post" "This is my first post")
(blog-insert-post! (blog-insert-post!