Fixing a format bug

svn: r11303
This commit is contained in:
Jay McCarthy 2008-08-18 22:11:08 +00:00
parent dd870c3d30
commit 972128abf0
2 changed files with 11 additions and 4 deletions

View File

@ -35,7 +35,10 @@
;; Queries for the post ids
(define (blog-posts a-blog)
(local [(define (row->post a-row)
(make-post a-blog (string->number (vector-ref a-row 0))))
(make-post
a-blog
(string->number
(vector-ref a-row 0))))
(define rows (sqlite:select
(blog-db a-blog)
"SELECT id FROM posts"))]
@ -74,8 +77,9 @@
(define rows
(sqlite:select
(blog-db (post-blog p))
(format "SELECT content FROM comments WHERE pid = '~a'"
(post-id p))))]
(format
"SELECT content FROM comments WHERE pid = '~a'"
(post-id p))))]
(cond
[(empty? rows) empty]
[else (map row->comment (rest rows))])))

View File

@ -1062,7 +1062,10 @@ The only function that creates posts is @scheme[blog-posts]:
@code:comment{Queries for the post ids}
(define (blog-posts a-blog)
(local [(define (row->post a-row)
(make-post a-blog (string->number (vector-ref a-row 0))))
(make-post
a-blog
(string->number
(vector-ref a-row 0))))
(define rows (sqlite:select
(blog-db a-blog)
"SELECT id FROM posts"))]